thunderhub/drizzle/sqlite/meta/0003_snapshot.json
Kilombino f62b48fa24
feat: per-channel notes (inline editing in channels table) (#744)
* feat(db): add channel_notes table with Drizzle schema and migrations

Adds a new `channel_notes` table (SQLite + PG) with composite PK
(account_id, channel_id) to persist per-channel notes scoped to each
ThunderHub account. Includes migration files for both database backends.

* feat(api): add ChannelNotesService with getChannelNotes query and setChannelNote mutation

Introduces ChannelNotesService (Drizzle-backed, account-scoped) with
getNotes/upsertNote methods. Exposes two new GraphQL endpoints on
ChannelsResolver: getChannelNotes (query) and setChannelNote (mutation).

* feat(client): add inline channel notes to channels table and details panel

- Adds NoteCell component to ChannelTable with click-to-edit inline input
  (Enter/✓ to save, Escape to cancel)
- Fetches all notes on load via getChannelNotes query; updates optimistically
- Adds note textarea + Save button in ChannelDetails modal below fee editor
- Notes are persisted server-side and survive page refreshes

* chore: table changes

* chore: schema cleanup

* chore: cleanup table

* chore: more cleanup

* chore: db ondelete

---------

Co-authored-by: Anthony Potdevin <potdevin.anthony@gmail.com>
2026-04-29 21:31:54 -06:00

426 lines
No EOL
11 KiB
JSON

{
"version": "6",
"dialect": "sqlite",
"id": "62dfa64c-8696-4c03-9c25-2921fff5fd5f",
"prevId": "2b0142c3-134e-4c4d-b5ef-e7aae8280038",
"tables": {
"channel_metadata": {
"name": "channel_metadata",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"node_id": {
"name": "node_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"channel_id": {
"name": "channel_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"note": {
"name": "note",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
}
},
"indexes": {
"channel_metadata_user_id_node_id_channel_id_unique": {
"name": "channel_metadata_user_id_node_id_channel_id_unique",
"columns": [
"user_id",
"node_id",
"channel_id"
],
"isUnique": true
}
},
"foreignKeys": {
"channel_metadata_user_id_users_id_fk": {
"name": "channel_metadata_user_id_users_id_fk",
"tableFrom": "channel_metadata",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"channel_metadata_node_id_nodes_id_fk": {
"name": "channel_metadata_node_id_nodes_id_fk",
"tableFrom": "channel_metadata",
"tableTo": "nodes",
"columnsFrom": [
"node_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"nodes": {
"name": "nodes",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"team_id": {
"name": "team_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"network": {
"name": "network",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"socket": {
"name": "socket",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"encrypted_macaroon": {
"name": "encrypted_macaroon",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"encrypted_cert": {
"name": "encrypted_cert",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"encrypted_amboss_jwt": {
"name": "encrypted_amboss_jwt",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
}
},
"indexes": {},
"foreignKeys": {
"nodes_team_id_teams_id_fk": {
"name": "nodes_team_id_teams_id_fk",
"tableFrom": "nodes",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"teams": {
"name": "teams",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"user_nodes": {
"name": "user_nodes",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"node_id": {
"name": "node_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
}
},
"indexes": {
"user_nodes_user_id_node_id_unique": {
"name": "user_nodes_user_id_node_id_unique",
"columns": [
"user_id",
"node_id"
],
"isUnique": true
}
},
"foreignKeys": {
"user_nodes_user_id_users_id_fk": {
"name": "user_nodes_user_id_users_id_fk",
"tableFrom": "user_nodes",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"user_nodes_node_id_nodes_id_fk": {
"name": "user_nodes_node_id_nodes_id_fk",
"tableFrom": "user_nodes",
"tableTo": "nodes",
"columnsFrom": [
"node_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"users": {
"name": "users",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"password_hash": {
"name": "password_hash",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'member'"
},
"team_id": {
"name": "team_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))"
}
},
"indexes": {
"users_email_unique": {
"name": "users_email_unique",
"columns": [
"email"
],
"isUnique": true
}
},
"foreignKeys": {
"users_team_id_teams_id_fk": {
"name": "users_team_id_teams_id_fk",
"tableFrom": "users",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}