added option do_migration_to_winix_fullmorm do the config (only temporarily)
if true then we make Item::do_migration() and exit
This commit is contained in:
@@ -223,21 +223,23 @@ return !is_that_url;
|
||||
}
|
||||
|
||||
|
||||
void Item::do_migration(morm::ModelConnector * model_connector)
|
||||
void Item::do_migration(morm::ModelConnector * model_connector, Log & log)
|
||||
{
|
||||
return;
|
||||
///////
|
||||
|
||||
morm::Finder<Item> finder(model_connector);
|
||||
|
||||
std::list<Item> list = finder.select().where().eq(L"type", static_cast<int>(Item::dir)).eq(L"content_id", -1).get_list();
|
||||
|
||||
// for(Item & item : list)
|
||||
// {
|
||||
// item.item_content.set_save_mode(morm::Model::DO_INSERT_ON_SAVE);
|
||||
// item.save();
|
||||
// }
|
||||
std::list<Item> list = finder.
|
||||
select().
|
||||
where().
|
||||
eq(L"type", static_cast<int>(Item::dir)).
|
||||
eq(L"content_id", -1).
|
||||
get_list();
|
||||
|
||||
for(Item & item : list)
|
||||
{
|
||||
log << "updating item id: " << item.id << ", type: " << (int)item.type << ", url: " << item.url << ", subject: " << item.subject << logend << logsave;
|
||||
item.item_content.set_save_mode(morm::Model::DO_INSERT_ON_SAVE);
|
||||
item.save();
|
||||
}
|
||||
}
|
||||
|
||||
void Item::propagate_connector()
|
||||
|
Reference in New Issue
Block a user