Skip to content

Instantly share code, notes, and snippets.

@igkuz
Created March 9, 2019 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igkuz/5e2bc41b7b39ded786a8189069f3f351 to your computer and use it in GitHub Desktop.
Save igkuz/5e2bc41b7b39ded786a8189069f3f351 to your computer and use it in GitHub Desktop.
Migrations
ROM::SQL.migration do
change do
create_table :companies do
primary_key :id
column :name, String, null: false
column :domain, String, null: false
column :state, String, null: false, default: 'running'
column :created_at, DateTime
column :updated_at, DateTime
end
end
end
ROM::SQL.migration do
change do
create_table :posts do
primary_key :id
column :url, String, unique: true, null: false
column :se_post, :boolean, null: false, default: false
column :published_at, DateTime
column :scrapped_at, DateTime, null: false
column :error, String
column :stats, JSON
column :created_at, DateTime
column :updated_at, DateTime
foreign_key :company_id, :companies
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment