librarix/db/migrations/0001_create_database.rb

19 lines
463 B
Ruby
Raw Permalink Normal View History

Sequel.migration do
change do
create_table(:genres) do
primary_key :id
String :name, null: false
end
create_table(:movies) do
primary_key :id
String :data, text: true, null: false
FalseClass :added, null: false, default: false
FalseClass :viewed, null: false, default: false
FalseClass :downloaded, null: false, default: false
end
create_join_table(movie_id: :movies, genre_id: :genres)
end
end