Class: CreatePlayerMigration

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/app/migrations/1606736477_create_player_migration.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rubypitaya-3.12.1/lib/rubypitaya/app-template/app/migrations/1606736477_create_player_migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



7
8
9
10
11
12
13
14
# File 'lib/rubypitaya/app-template/app/migrations/1606736477_create_player_migration.rb', line 7

def change
  create_table :players, id: :uuid do |t|
    t.belongs_to :user, type: :uuid, foreing_key: true, index: { unique: true }
    t.string :name, null: false
    t.integer :gold, null: false
    t.timestamps null: false
  end
end