Quellcode durchsuchen

补充迁移文件字段

abiao vor 5 Jahren
Ursprung
Commit
0901608dda
1 geänderte Dateien mit 7 neuen und 5 gelöschten Zeilen
  1. 7 5
      db/migrate/20200808124641_create_product_attrs.rb

+ 7 - 5
db/migrate/20200808124641_create_product_attrs.rb

@@ -38,12 +38,14 @@ class CreateProductAttrs < ActiveRecord::Migration
 
     add_index :product_attr_configs, :product_id
     add_index :product_attr_configs, :attr_key_id
-    add_column :products, :size_id, :integer
-    add_column :products, :color_id, :integer
+    add_column :products, :size_id, :integer,:default => 0,:limit => 8
+    add_column :products, :color_id, :integer,:default => 0,:limit => 8
     add_column :products, :relate_product_id, :integer
-    add_column :products, :show_flag, :boolean
-    add_column :order_details, :size_name, :string
-    add_column :order_details, :color_name, :string
+    add_column :products, :show_flag, :boolean,:limit => 8
+    add_column :order_details, :size_name,:string,:limit => 128
+    add_column :order_details, :color_name,:string,:limit => 128
+    add_index :products, :size_id
+    add_index :products, :color_id
   end
 
   def down