feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,45 @@
|
||||
import BaseModel, { DeleteOptions } from '../BaseModel';
|
||||
import { ResourceLocalStateEntity } from '../services/database/types';
|
||||
import Database from '../database';
|
||||
import ActionLogger from '../utils/ActionLogger';
|
||||
|
||||
export default class ResourceLocalState extends BaseModel {
|
||||
public static tableName() {
|
||||
return 'resource_local_states';
|
||||
}
|
||||
|
||||
public static modelType() {
|
||||
return BaseModel.TYPE_RESOURCE_LOCAL_STATE;
|
||||
}
|
||||
|
||||
public static async byResourceId(resourceId: string) {
|
||||
if (!resourceId) throw new Error('Resource ID not provided'); // Sanity check
|
||||
|
||||
const result = await this.modelSelectOne('SELECT * FROM resource_local_states WHERE resource_id = ?', [resourceId]);
|
||||
|
||||
if (!result) {
|
||||
const defaultRow = this.db().createDefaultRow(this.tableName());
|
||||
delete defaultRow.id;
|
||||
defaultRow.resource_id = resourceId;
|
||||
return defaultRow;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static saveQueries(o: ResourceLocalStateEntity) {
|
||||
return [{ sql: 'DELETE FROM resource_local_states WHERE resource_id = ?', params: [o.resource_id] }, Database.insertQuery(this.tableName(), o)];
|
||||
}
|
||||
|
||||
public static async save(o: ResourceLocalStateEntity) {
|
||||
return this.db().transactionExecBatch(this.saveQueries(o));
|
||||
}
|
||||
|
||||
public static batchDelete(ids: string[], options: DeleteOptions = {}) {
|
||||
options = { ...options };
|
||||
options.idFieldName = 'resource_id';
|
||||
options.sourceDescription = ActionLogger.from(options.sourceDescription);
|
||||
options.sourceDescription.addDescription('Delete local resource state');
|
||||
return super.batchDelete(ids, options);
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户