فهرست منبع

Remove constraint on user email

Andrew Swistak 5 سال پیش
والد
کامیت
610c195483
2فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 5 0
      db/migrate/20200118200407_remove_not_null_constraint_on_user_email.rb
  2. 2 2
      db/schema.rb

+ 5 - 0
db/migrate/20200118200407_remove_not_null_constraint_on_user_email.rb

@@ -0,0 +1,5 @@
+class RemoveNotNullConstraintOnUserEmail < ActiveRecord::Migration[6.0]
+  def change
+    change_column :users, :email, :string, null: true
+  end
+end

+ 2 - 2
db/schema.rb

@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 2020_01_05_063306) do
+ActiveRecord::Schema.define(version: 2020_01_18_200407) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -26,7 +26,7 @@ ActiveRecord::Schema.define(version: 2020_01_05_063306) do
 
   create_table "users", force: :cascade do |t|
     t.string "username", default: "", null: false
-    t.string "email", default: "", null: false
+    t.string "email", default: ""
     t.string "password_digest", default: "", null: false
     t.string "reset_password_token"
     t.datetime "reset_password_sent_at"