diff --git a/Rakefile b/Rakefile index ae55317..fd6f0d8 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +require 'bundler/setup' + require 'sequel' require 'sqlite3' diff --git a/db/migrations/0001_add_items_table.rb b/db/migrations/0001_add_items_table.rb index 86f67ad..8cdd701 100644 --- a/db/migrations/0001_add_items_table.rb +++ b/db/migrations/0001_add_items_table.rb @@ -10,8 +10,8 @@ Sequel.migration do String :type String :purchased_from DateTime :purchased_at - DateTime :created_at - DateTime :updated_at + DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP + DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP end end diff --git a/db/migrations/0002_add_item_comments_table.rb b/db/migrations/0002_add_item_comments_table.rb index 5620a75..97ceb3a 100644 --- a/db/migrations/0002_add_item_comments_table.rb +++ b/db/migrations/0002_add_item_comments_table.rb @@ -4,8 +4,8 @@ Sequel.migration do create_table(:item_comments) do primary_key :id String :body, null: false - DateTime :created_at - DateTime :updated_at + DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP + DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP end alter_table(:item_comments) do diff --git a/db/migrations/0004_add_license_comments_table.rb b/db/migrations/0004_add_license_comments_table.rb index 32e6687..21bf074 100644 --- a/db/migrations/0004_add_license_comments_table.rb +++ b/db/migrations/0004_add_license_comments_table.rb @@ -4,12 +4,12 @@ Sequel.migration do create_table(:license_comments) do primary_key :id String :body, null: false - DateTime :created_at - DateTime :updated_at + DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP + DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP end alter_table(:license_comments) do - add_foreign_key :license_id, :items + add_foreign_key :license_id, :licenses end end