Update field nullable and default value
This commit is contained in:
parent
c78a28c676
commit
840dbeb697
3 changed files with 17 additions and 4 deletions
7
db/migrate/20220304091854_add_default_values_to_user.rb
Normal file
7
db/migrate/20220304091854_add_default_values_to_user.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
class AddDefaultValuesToUser < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
change_column :users, :picture, :string, :default => "gran"
|
||||
change_column :users, :language, :string, :default => "en"
|
||||
change_column :users, :private, :boolean, :default => false
|
||||
end
|
||||
end
|
||||
6
db/migrate/20220304092134_add_not_nullable_to_user.rb
Normal file
6
db/migrate/20220304092134_add_not_nullable_to_user.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class AddNotNullableToUser < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
change_column :users, :language, :string, :default => "en", :null => false
|
||||
change_column :users, :private, :boolean, :default => false, :null => false
|
||||
end
|
||||
end
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2022_03_04_091218) do
|
||||
ActiveRecord::Schema.define(version: 2022_03_04_092134) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pgcrypto"
|
||||
|
|
@ -186,9 +186,9 @@ ActiveRecord::Schema.define(version: 2022_03_04_091218) do
|
|||
t.integer "granblue_id"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.string "picture"
|
||||
t.string "language"
|
||||
t.boolean "private"
|
||||
t.string "picture", default: "gran"
|
||||
t.string "language", default: "en", null: false
|
||||
t.boolean "private", default: false, null: false
|
||||
end
|
||||
|
||||
create_table "weapon_keys", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||
|
|
|
|||
Loading…
Reference in a new issue