Skip to content

Commit

Permalink
push up latest schema
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed Jul 17, 2024
1 parent cc39276 commit c6cf4c3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ CREATE TABLE `blocks` (
`target_number` integer NOT NULL,
`epoch_time` integer NOT NULL,
`current_posix_time` integer NOT NULL,
`nonce` text(32)
`nonce` text(64),
`miner_cred` text,
`nft_cred` text(120),
`data` text
);
--> statement-breakpoint
CREATE UNIQUE INDEX `blocks_hash_unique` ON `blocks` (`hash`);
25 changes: 23 additions & 2 deletions migrations/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
"id": "dfb1da91-7ce9-427f-b65b-a6dedab53a34",
"id": "b051fed5-1dde-419a-ac35-ca7a3642a698",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"blocks": {
Expand Down Expand Up @@ -51,7 +51,28 @@
},
"nonce": {
"name": "nonce",
"type": "text(32)",
"type": "text(64)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"miner_cred": {
"name": "miner_cred",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"nft_cred": {
"name": "nft_cred",
"type": "text(120)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"data": {
"name": "data",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
Expand Down
4 changes: 2 additions & 2 deletions migrations/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "6",
"when": 1720299004477,
"tag": "0000_futuristic_stellaris",
"when": 1721177302472,
"tag": "0000_friendly_bromley",
"breakpoints": true
}
]
Expand Down
7 changes: 6 additions & 1 deletion src/lib/server/schema.sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ export const blocks = sqliteTable('blocks', {
epochTime: integer('epoch_time').notNull(),
currentPosixTime: integer('current_posix_time').notNull(),
// only the genesis block has an undefined nonce
nonce: text('nonce', { length: 32 }),
nonce: text('nonce', { length: 64 }),
// payment key of 28 bytes
// NFT max of 60 bytes
paymentCred: text('miner_cred'),
nftCred: text('nft_cred', { length: 120 }),
data: text('data'),
});

0 comments on commit c6cf4c3

Please sign in to comment.