Skip to content

Instantly share code, notes, and snippets.

@jbranchaud
Created August 3, 2015 18:14
Show Gist options
  • Save jbranchaud/cf2404ee6c29fa338a82 to your computer and use it in GitHub Desktop.
Save jbranchaud/cf2404ee6c29fa338a82 to your computer and use it in GitHub Desktop.
# with postgres DDL
execute SQL<<-
create table users(
...
created_at timestamptz not null,
updated_at timestamptz not null
);
SQL
# with Rails DSL
create_table :users do |t|
...
t.column :created_at, 'timestamp with time zone', null: false
t.column :updated_at, 'timestamp with time zone', null: false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment