Monorepo for Tangled tangled.org
856
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/db: remove fk relationship of statuses on pipelines

ingest it all.

Signed-off-by: oppiliappan <me@oppi.li>

+30
+30
appview/db/db.go
··· 1519 1519 }) 1520 1520 conn.ExecContext(ctx, "pragma foreign_keys = on;") 1521 1521 1522 + conn.ExecContext(ctx, "pragma foreign_keys = off;") 1523 + orm.RunMigration(conn, logger, "drop-pipeline-statuses-pipeline-fk", func(tx *sql.Tx) error { 1524 + _, err := tx.Exec(` 1525 + create table if not exists pipeline_statuses_new ( 1526 + id integer primary key autoincrement, 1527 + spindle text not null, 1528 + rkey text not null, 1529 + 1530 + pipeline_knot text not null, 1531 + pipeline_rkey text not null, 1532 + 1533 + created text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')), 1534 + workflow text not null, 1535 + status text not null, 1536 + error text, 1537 + exit_code integer not null default 0, 1538 + 1539 + unique (spindle, rkey) 1540 + ); 1541 + 1542 + insert into pipeline_statuses_new 1543 + select * from pipeline_statuses; 1544 + 1545 + drop table pipeline_statuses; 1546 + alter table pipeline_statuses_new rename to pipeline_statuses; 1547 + `) 1548 + return err 1549 + }) 1550 + conn.ExecContext(ctx, "pragma foreign_keys = on;") 1551 + 1522 1552 return &DB{ 1523 1553 db, 1524 1554 logger,