Use pgcrypto for uuids
This commit is contained in:
parent
f616fe23db
commit
a535091b64
6 changed files with 10 additions and 5 deletions
5
db/migrate/2020091309001_enable_pgcrypto_extension.rb
Normal file
5
db/migrate/2020091309001_enable_pgcrypto_extension.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class EnablePgcryptoExtension < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
enable_extension 'pgcrypto'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
class CreateUsers < ActiveRecord::Migration[6.0]
|
class CreateUsers < ActiveRecord::Migration[6.0]
|
||||||
def change
|
def change
|
||||||
create_table :users, id: :uuid do |t|
|
create_table :users, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||||
t.string :email
|
t.string :email
|
||||||
t.string :password
|
t.string :password
|
||||||
t.string :username
|
t.string :username
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
class CreateWeapons < ActiveRecord::Migration[6.0]
|
class CreateWeapons < ActiveRecord::Migration[6.0]
|
||||||
def change
|
def change
|
||||||
create_table :weapons, id: :uuid do |t|
|
create_table :weapons, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||||
t.string :name_en
|
t.string :name_en
|
||||||
t.string :name_jp
|
t.string :name_jp
|
||||||
t.integer :granblue_id
|
t.integer :granblue_id
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
class CreateParties < ActiveRecord::Migration[6.0]
|
class CreateParties < ActiveRecord::Migration[6.0]
|
||||||
def change
|
def change
|
||||||
create_table :parties, id: :uuid do |t|
|
|
||||||
t.belongs_to :user, type: :uuid
|
t.belongs_to :user, type: :uuid
|
||||||
|
create_table :parties, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||||
|
|
||||||
t.string :hash
|
t.string :hash
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
class CreateGridWeapons < ActiveRecord::Migration[6.0]
|
class CreateGridWeapons < ActiveRecord::Migration[6.0]
|
||||||
def change
|
def change
|
||||||
create_table :grid_weapons do |t|
|
|
||||||
t.belongs_to :composition, type: :uuid
|
t.belongs_to :composition, type: :uuid
|
||||||
|
|
||||||
|
create_table :grid_weapons, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||||
t.references :weapon, type: :uuid
|
t.references :weapon, type: :uuid
|
||||||
t.references :weapon_key1, class_name: 'WeaponKey', type: :uuid
|
t.references :weapon_key1, class_name: 'WeaponKey', type: :uuid
|
||||||
t.references :weapon_key2, class_name: 'WeaponKey', type: :uuid
|
t.references :weapon_key2, class_name: 'WeaponKey', type: :uuid
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
class CreateWeaponKeys < ActiveRecord::Migration[6.0]
|
class CreateWeaponKeys < ActiveRecord::Migration[6.0]
|
||||||
def change
|
def change
|
||||||
create_table :weapon_keys do |t|
|
create_table :weapon_keys, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
||||||
t.string :name_en
|
t.string :name_en
|
||||||
t.string :name_jp
|
t.string :name_jp
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue