change migration index length

This commit is contained in:
chenjing 2023-06-13 16:09:35 +08:00
parent cfaa5301ea
commit 0a483cf762
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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