feat: identity inactive cleanup — migration script + release.rs excludes status='inactive'
- New SQL migration: mark auto identities with no face references as inactive - release.rs identities export now filters out status='inactive'
This commit is contained in:
@@ -406,12 +406,12 @@ async fn cmd_package(db: &PostgresDb, uuid: &str) -> Result<()> {
|
||||
|
||||
// Export identities with file_uuid (direct column, no JOIN needed)
|
||||
// FILE LOCAL: file_uuid = '{uuid}'
|
||||
// GLOBAL (cross-file): tmdb identities + user-defined (exclude inactive auto)
|
||||
// GLOBAL (cross-file): tmdb identities + user-defined (exclude inactive auto + status='inactive')
|
||||
let idents_name = "dev_identities";
|
||||
let idents_path = sql_dir.join(format!("{}.sql", idents_name));
|
||||
{
|
||||
let idents_query = format!(
|
||||
"COPY (SELECT * FROM dev.identities WHERE file_uuid = '{}' OR (file_uuid IS NULL AND source IN ('tmdb', 'merged', 'user_defined'))) TO STDOUT WITH CSV HEADER", uuid
|
||||
"COPY (SELECT * FROM dev.identities WHERE (file_uuid = '{}' OR (file_uuid IS NULL AND source IN ('tmdb', 'merged', 'user_defined'))) AND status IS DISTINCT FROM 'inactive') TO STDOUT WITH CSV HEADER", uuid
|
||||
);
|
||||
let cols = psql_exec(&format!(
|
||||
"SELECT string_agg(column_name, ', ' ORDER BY ordinal_position) FROM information_schema.columns WHERE table_schema='dev' AND table_name='identities' AND is_updatable='YES'"
|
||||
|
||||
Reference in New Issue
Block a user