change migration index length
This commit is contained in:
parent
cfaa5301ea
commit
0a483cf762
|
@ -2,12 +2,14 @@ class CreateClas < ActiveRecord::Migration[5.2]
|
|||
def change
|
||||
create_table :clas do |t|
|
||||
t.string :name, null:false
|
||||
t.string :key, index:true, null:false
|
||||
t.string :key, null:false
|
||||
t.text :content
|
||||
t.integer :organization_id, index:true, null:false
|
||||
t.integer :organization_id, null:false
|
||||
t.boolean :pr_need, default: false
|
||||
t.integer :count, default: 0
|
||||
t.timestamps
|
||||
end
|
||||
add_index :clas, :key, :length =>190
|
||||
add_index :clas, :organization_id
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
class CreateUserClas < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :user_clas do |t|
|
||||
t.integer :user_id, null:false, index: true
|
||||
t.integer :cla_id, null:false, index: true
|
||||
t.integer :user_id, null:false
|
||||
t.integer :cla_id, null:false
|
||||
t.string :real_name, null:false
|
||||
t.string :email, null:false
|
||||
t.integer :state, default:0
|
||||
t.timestamps
|
||||
end
|
||||
add_index :user_clas, :user_id
|
||||
add_index :user_clas, :cla_id
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue