Created
June 20, 2020 21:54
-
-
Save danielevans/49a2438b70466e8f5f940332a8efed95 to your computer and use it in GitHub Desktop.
Migration Example in Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateGames < ActiveRecord::Migration[5.2] | |
def change | |
create_table :games do |t| | |
t.integer :player_count | |
t.integer :board_count | |
t.string :rotation | |
t.datetime :starts_at | |
t.string :commongame_reference | |
t.timestamps | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Column | Type | Collation | Nullable | Default | |
----------------------+-----------------------------+-----------+----------+----------------------------------- | |
id | bigint | | not null | nextval('games_id_seq'::regclass) | |
board_count | integer | | | | |
rotation | character varying | | | | |
starts_at | timestamp without time zone | | | | |
commongame_reference | character varying | | | | |
created_at | timestamp without time zone | | not null | | |
updated_at | timestamp without time zone | | not null | | |
Indexes: | |
"games_pkey" PRIMARY KEY, btree (id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment