Use pgcrypto for uuids

This commit is contained in:
Justin Edmund 2020-09-16 03:20:27 -07:00
parent f616fe23db
commit a535091b64
6 changed files with 10 additions and 5 deletions

View file

@ -0,0 +1,5 @@
class EnablePgcryptoExtension < ActiveRecord::Migration[5.0]
def change
enable_extension 'pgcrypto'
end
end

View file

@ -1,6 +1,6 @@
class CreateUsers < ActiveRecord::Migration[6.0]
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 :password
t.string :username

View file

@ -1,6 +1,6 @@
class CreateWeapons < ActiveRecord::Migration[6.0]
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_jp
t.integer :granblue_id

View file

@ -1,7 +1,7 @@
class CreateParties < ActiveRecord::Migration[6.0]
def change
create_table :parties, id: :uuid do |t|
t.belongs_to :user, type: :uuid
create_table :parties, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :hash

View file

@ -1,8 +1,8 @@
class CreateGridWeapons < ActiveRecord::Migration[6.0]
def change
create_table :grid_weapons do |t|
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_key1, class_name: 'WeaponKey', type: :uuid
t.references :weapon_key2, class_name: 'WeaponKey', type: :uuid

View file

@ -1,6 +1,6 @@
class CreateWeaponKeys < ActiveRecord::Migration[6.0]
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_jp