mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: support updating the view name and icon through document (#3099)
* feat: support updating the view name and icon through document * fix: store expand pages * fix: refactor text link * fix: update cargo.toml * fix: update test * fix: update event map * fix: move deal with icon codes to a single file * fix: delete useless code from flutter * fix: document banner * fix: build error * fix: update rust library --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
@ -42,19 +42,18 @@ impl UserLocalDataMigration {
|
||||
pub fn run(self, migrations: Vec<Box<dyn UserDataMigration>>) -> FlowyResult<Vec<String>> {
|
||||
let mut applied_migrations = vec![];
|
||||
let conn = self.sqlite_pool.get()?;
|
||||
let record = get_all_records(&*conn)?;
|
||||
let record = get_all_records(&conn)?;
|
||||
let mut duplicated_names = vec![];
|
||||
for migration in migrations {
|
||||
if record
|
||||
if !record
|
||||
.iter()
|
||||
.find(|record| record.migration_name == migration.name())
|
||||
.is_none()
|
||||
.any(|record| record.migration_name == migration.name())
|
||||
{
|
||||
let migration_name = migration.name().to_string();
|
||||
if !duplicated_names.contains(&migration_name) {
|
||||
migration.run(&self.session, &self.collab_db)?;
|
||||
applied_migrations.push(migration.name().to_string());
|
||||
save_record(&*conn, &migration_name);
|
||||
save_record(&conn, &migration_name);
|
||||
duplicated_names.push(migration_name);
|
||||
} else {
|
||||
tracing::error!("Duplicated migration name: {}", migration_name);
|
||||
|
@ -86,7 +86,7 @@ impl UserSession {
|
||||
.run(vec![Box::new(HistoricalEmptyDocumentMigration)])
|
||||
{
|
||||
Ok(applied_migrations) => {
|
||||
if applied_migrations.len() > 0 {
|
||||
if !applied_migrations.is_empty() {
|
||||
tracing::info!("Did apply migrations: {:?}", applied_migrations);
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user