Replies: 1 comment 1 reply
-
The syntax error is the trailing comma. Something like this should work: create_table(:new_albums) do
primary_key :id
foreign_key :artist_id, :new_artists
String :name
Time :bdate
Integer :year
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is the learning curve biting me (i think). This seems like the most basic, simple thing, but i can't figure out what's wrong:
`require 'sequel'
require 'pg'
create_table (:new_albums) do
primary_key :id,
foreign_key :artist_id, :new_artists
String :name,
Time :bdate,
Integer :year
end
Running this produces:
/sequel2.rb: --> ./sequel2.rb
syntax error, unexpected symbol literal, expecting `do' or '{' or '('
6 create_table (:new_albums) do
./sequel2.rb:8: syntax error, unexpected symbol literal, expecting `do' or '{' or '(' (SyntaxError)
foreign_key :artist_id, :new_artists
^
I have no idea what the problem is. I've tried all sorts of variants... eliminating line 8 just moves the error to line 9, rm'g line 9, moves it to line 10... but same syntax error. I had the "Sequel.connect..." before all this but taking it out makes no difference.
What am i doing wrong???
Beta Was this translation helpful? Give feedback.
All reactions