Browse Source

change migration index length

pull/343/head
chenjing 3 years ago
parent
commit
0a483cf762
2 changed files with 9 additions and 4 deletions
  1. +4
    -2
      db/migrate/20230612031416_create_clas.rb
  2. +5
    -2
      db/migrate/20230612031448_create_user_clas.rb

+ 4
- 2
db/migrate/20230612031416_create_clas.rb 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

+ 5
- 2
db/migrate/20230612031448_create_user_clas.rb 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

Loading…
Cancel
Save