renamed: ItemContent::meta_admin -> ItemContent::admin_meta
This commit is contained in:
@@ -83,7 +83,7 @@ void ItemContent::fields()
|
||||
field(L"content_parsed", content_parsed);
|
||||
field(L"content_parsed_type", content_parsed_type_helper);
|
||||
field(L"meta", meta);
|
||||
field(L"meta_admin", meta_admin);
|
||||
field(L"admin_meta", admin_meta);
|
||||
|
||||
field(L"print_content", &ItemContent::print_content);
|
||||
field(L"has_static_file", &ItemContent::has_static_file);
|
||||
@@ -103,6 +103,8 @@ void ItemContent::fields()
|
||||
field(L"has_thumb", &ItemContent::has_thumb);
|
||||
field(L"display_user_name", &ItemContent::display_user_name);
|
||||
|
||||
field(L"is_meta_object", &ItemContent::is_meta_object);
|
||||
field(L"is_admin_meta_object", &ItemContent::is_admin_meta_object);
|
||||
|
||||
// IMPROVEME prepare a setter functions which tests whether content_raw_type_helper and content_parsed_type_helper are correct values
|
||||
content_raw_type = static_cast<ContentType>(content_raw_type_helper);
|
||||
@@ -168,7 +170,7 @@ void ItemContent::Clear()
|
||||
content_parsed_type = ct_formatted_text;
|
||||
|
||||
meta.clear();
|
||||
meta_admin.clear();
|
||||
admin_meta.clear();
|
||||
|
||||
SetDateToNow();
|
||||
}
|
||||
@@ -182,6 +184,7 @@ bool ItemContent::do_migration(int & current_table_version)
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 1, this, &ItemContent::do_migration_to_1);
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 2, this, &ItemContent::do_migration_to_2);
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 3, this, &ItemContent::do_migration_to_3);
|
||||
ok = ok && morm::Model::do_migration(current_table_version, 4, this, &ItemContent::do_migration_to_4);
|
||||
|
||||
return ok;
|
||||
}
|
||||
@@ -257,6 +260,17 @@ bool ItemContent::do_migration_to_3()
|
||||
}
|
||||
|
||||
|
||||
bool ItemContent::do_migration_to_4()
|
||||
{
|
||||
const char * str[] = {
|
||||
"alter table core.content rename column meta_admin to admin_meta;",
|
||||
};
|
||||
|
||||
size_t len = sizeof(str) / sizeof(const char*);
|
||||
return db_query(str, len);
|
||||
}
|
||||
|
||||
|
||||
bool ItemContent::has_access(const User * current_user, int mask) const
|
||||
{
|
||||
if( current_user )
|
||||
@@ -586,6 +600,16 @@ void ItemContent::display_user_name(EzcEnv & env)
|
||||
}
|
||||
|
||||
|
||||
bool ItemContent::is_meta_object()
|
||||
{
|
||||
return meta.is_object();
|
||||
}
|
||||
|
||||
|
||||
bool ItemContent::is_admin_meta_object()
|
||||
{
|
||||
return admin_meta.is_object();
|
||||
}
|
||||
|
||||
|
||||
} // namespace Winix
|
||||
|
Reference in New Issue
Block a user