add primary keys definition to migration rules
This commit is contained in:
@@ -199,6 +199,7 @@ bool Item::do_migration(int & current_table_version)
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 2, this, &Item::do_migration_to_2);
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 3, this, &Item::do_migration_to_3);
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 4, this, &Item::do_migration_to_4);
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 5, this, &Item::do_migration_to_5);
|
||||
|
||||
return ok;
|
||||
}
|
||||
@@ -313,6 +314,17 @@ bool Item::do_migration_to_4()
|
||||
}
|
||||
|
||||
|
||||
bool Item::do_migration_to_5()
|
||||
{
|
||||
const char * str[] = {
|
||||
"ALTER TABLE core.item ADD CONSTRAINT item_pkey PRIMARY KEY (id);",
|
||||
};
|
||||
|
||||
size_t len = sizeof(str) / sizeof(const char*);
|
||||
return db_query(str, len);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Item::can_remove_child(const User * current_user, long child_user_id) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user