E1: schema dell'esportazione, migrazione 0003, archivi ed ExportSettings (#58)
La tappa E1 della 0.3.0 prepara il database per le copie esterne senza cambiare comportamento: nulla in interfaccia, motore o API usa ancora ciò che segue. - Migrazione 0003: export_destination, export_account, export_copy, export_run, export_item, video_analysis e media_conversion (risposta di Alberto del 26 novembre: i convertiti per la libreria in una tabella a parte, media non cambia), con i vincoli e gli indici di §8.3. - Archivi IExportStore, IVideoAnalysisStore e IMediaConversionStore in IFebeStorage; ExportSettings sulle cinque chiavi esportazione.*. - AccountStore.DeleteAsync spegne «Automatica» delle cartelle dell'account e vi scrive il suo nome prima di cancellarlo (finché non ci sono destinazioni non fa nulla). - Prove: aggiornamento dei database delle versioni 1 e 2 con foreign_key_check pulito, database più nuovo rifiutato e lasciato intatto, vincoli, archivi, piani delle ricerche, impostazioni e documenti. - SPECIFICA §4.10, §8.3 e §15, decisioni.md e stato.md aggiornati. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc92cabe5c
commit
ea4666d49b
23 files changed
+3756
-7
No files matched your search
@@ -467,7 +467,20 @@ internal sealed class AccountStore(FebeDatabase db) : IAccountStore
|
||||
ct);
|
||||
|
||||
public Task DeleteAsync(long accountId, CancellationToken ct = default) =>
|
||||
db.WriteAsync(w => w.Command("DELETE FROM account WHERE id = @id").With("@id", accountId).ExecuteNonQuery(), ct);
|
||||
db.WriteAsync(
|
||||
w =>
|
||||
{
|
||||
// Its export destinations stay, disabled (spec §4.10): «Automatica» goes off and forgets «Solo i nuovi», so
|
||||
// attaching the folder again never restarts it without asking; they keep the user name, then ON DELETE SET
|
||||
// NULL clears the link. CHECKs of export_destination make the delete fail if either is not written first.
|
||||
w.Command("""
|
||||
UPDATE export_destination SET removed_account_username = (SELECT username FROM account WHERE id = @id),
|
||||
automatic = 0, automatic_since = NULL
|
||||
WHERE account_id = @id
|
||||
""").With("@id", accountId).ExecuteNonQuery();
|
||||
w.Command("DELETE FROM account WHERE id = @id").With("@id", accountId).ExecuteNonQuery();
|
||||
},
|
||||
ct);
|
||||
|
||||
private static Account? ReadOne(SqliteCommand command)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user