@secondlayer/shared 7.2.1 → 7.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,8 @@ import { type Kysely, sql } from "kysely";
|
|
|
5
5
|
// Clarity source), and statically-inferred SIP standards. `canonical` mirrors
|
|
6
6
|
// chain reorgs. The partial index on transactions makes the deploy backfill
|
|
7
7
|
// (WHERE type='smart_contract') an index scan, not a full-table seq scan.
|
|
8
|
-
|
|
8
|
+
// biome-ignore lint/suspicious/noExplicitAny: migration DDL is intentionally schema-dynamic
|
|
9
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
9
10
|
await sql`
|
|
10
11
|
CREATE TABLE contracts (
|
|
11
12
|
contract_id TEXT PRIMARY KEY,
|
|
@@ -38,7 +39,8 @@ export async function up(db: Kysely<unknown>): Promise<void> {
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
// biome-ignore lint/suspicious/noExplicitAny: migration DDL is intentionally schema-dynamic
|
|
43
|
+
export async function down(db: Kysely<any>): Promise<void> {
|
|
42
44
|
await sql`DROP INDEX IF EXISTS transactions_smart_contract_idx`.execute(db);
|
|
43
45
|
await sql`DROP TABLE IF EXISTS contracts`.execute(db);
|
|
44
46
|
}
|
|
@@ -10,7 +10,8 @@ import { type Kysely, sql } from "kysely";
|
|
|
10
10
|
// delete-by-height-then-insert (replace-per-height), which makes redelivery and
|
|
11
11
|
// shallow burnchain reorgs idempotent. `canonical` is reserved for a future
|
|
12
12
|
// mark-non-canonical reorg path; v1 keeps every row canonical.
|
|
13
|
-
|
|
13
|
+
// biome-ignore lint/suspicious/noExplicitAny: migration DDL is intentionally schema-dynamic
|
|
14
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
14
15
|
await sql`SET lock_timeout = '30s'`.execute(db);
|
|
15
16
|
|
|
16
17
|
await sql`
|
|
@@ -57,7 +58,8 @@ export async function up(db: Kysely<unknown>): Promise<void> {
|
|
|
57
58
|
);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
// biome-ignore lint/suspicious/noExplicitAny: migration DDL is intentionally schema-dynamic
|
|
62
|
+
export async function down(db: Kysely<any>): Promise<void> {
|
|
61
63
|
await sql`DROP TABLE IF EXISTS burn_block_reward_slots`.execute(db);
|
|
62
64
|
await sql`DROP TABLE IF EXISTS burn_block_rewards`.execute(db);
|
|
63
65
|
}
|
|
@@ -12,7 +12,8 @@ import { onChainPlane } from "../src/db/migration-role.ts";
|
|
|
12
12
|
// led with a constant-true boolean; a plain height index now serves the
|
|
13
13
|
// handler's per-height DELETE. Tables are small (≤2 reward rows + slot rows
|
|
14
14
|
// per burn block), so in-place DDL under the 30s lock_timeout is fine.
|
|
15
|
-
|
|
15
|
+
// biome-ignore lint/suspicious/noExplicitAny: migration DDL is intentionally schema-dynamic
|
|
16
|
+
export async function up(db: Kysely<any>): Promise<void> {
|
|
16
17
|
// Chain-plane tables only — under the split this must no-op on TARGET
|
|
17
18
|
// (the platform DB has no burnchain tables; unguarded CREATE INDEX there
|
|
18
19
|
// fails with 42P01 even with IF NOT EXISTS).
|
|
@@ -42,7 +43,8 @@ export async function up(db: Kysely<unknown>): Promise<void> {
|
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
// biome-ignore lint/suspicious/noExplicitAny: migration DDL is intentionally schema-dynamic
|
|
47
|
+
export async function down(db: Kysely<any>): Promise<void> {
|
|
46
48
|
await onChainPlane(async () => {
|
|
47
49
|
await sql`SET lock_timeout = '30s'`.execute(db);
|
|
48
50
|
|