feat: add span-label-types link to main page and create migration for default types

This commit is contained in:
Marko Djordjevic 2026-02-14 11:16:33 +01:00
parent 38cbdc22e1
commit 6a899c3ecf
4 changed files with 495 additions and 6 deletions

View file

@ -0,0 +1,8 @@
-- Insert default span label types (idempotent - skip if already exists)
INSERT OR IGNORE INTO `span_label_types` (`name`, `display_name`, `color`, `hotkey`, `is_active`, `sort_order`, `created_at`) VALUES
('bull_flag', 'Bull Flag', '#4CAF50', '1', 1, 1, strftime('%s', 'now')),
('bear_flag', 'Bear Flag', '#F44336', '2', 1, 2, strftime('%s', 'now')),
('triangle', 'Triangle', '#FF9800', '3', 1, 3, strftime('%s', 'now')),
('wedge', 'Wedge', '#9C27B0', '4', 1, 4, strftime('%s', 'now')),
('channel', 'Channel', '#2196F3', '5', 1, 5, strftime('%s', 'now')),
('consolidation', 'Consolidation', '#607D8B', '6', 1, 6, strftime('%s', 'now'));

View file

@ -0,0 +1,466 @@
{
"version": "6",
"dialect": "sqlite",
"id": "a8c3f2d1-e5b7-4a9f-b2d3-6c8e9f1a3b5c",
"prevId": "17f9ee96-d37f-4c25-97d8-45f8f1a4c868",
"tables": {
"annotation_types": {
"name": "annotation_types",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"is_active": {
"name": "is_active",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"annotation_types_name_unique": {
"name": "annotation_types_name_unique",
"columns": [
"name"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"annotations": {
"name": "annotations",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"chart_id": {
"name": "chart_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"timestamp": {
"name": "timestamp",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"label_type": {
"name": "label_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"geometry": {
"name": "geometry",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "'#3b82f6'"
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"annotations_chart_id_charts_id_fk": {
"name": "annotations_chart_id_charts_id_fk",
"tableFrom": "annotations",
"tableTo": "charts",
"columnsFrom": [
"chart_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"candles": {
"name": "candles",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"chart_id": {
"name": "chart_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time": {
"name": "time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"open": {
"name": "open",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"high": {
"name": "high",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"low": {
"name": "low",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"close": {
"name": "close",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"candles_chart_time_unique": {
"name": "candles_chart_time_unique",
"columns": [
"chart_id",
"time"
],
"isUnique": true
}
},
"foreignKeys": {
"candles_chart_id_charts_id_fk": {
"name": "candles_chart_id_charts_id_fk",
"tableFrom": "candles",
"tableTo": "charts",
"columnsFrom": [
"chart_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"charts": {
"name": "charts",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"charts_name_unique": {
"name": "charts_name_unique",
"columns": [
"name"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"span_annotations": {
"name": "span_annotations",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"chart_id": {
"name": "chart_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_time": {
"name": "start_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_time": {
"name": "end_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"confidence": {
"name": "confidence",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"outcome": {
"name": "outcome",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sub_spans": {
"name": "sub_spans",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'#2196F3'"
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"span_annotations_chart_id_charts_id_fk": {
"name": "span_annotations_chart_id_charts_id_fk",
"tableFrom": "span_annotations",
"tableTo": "charts",
"columnsFrom": [
"chart_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"span_label_types": {
"name": "span_label_types",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"display_name": {
"name": "display_name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"hotkey": {
"name": "hotkey",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"is_active": {
"name": "is_active",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"span_label_types_name_unique": {
"name": "span_label_types_name_unique",
"columns": [
"name"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View file

@ -29,6 +29,13 @@
"when": 1771044740273,
"tag": "0003_demonic_captain_flint",
"breakpoints": true
},
{
"idx": 4,
"version": "6",
"when": 1771055000000,
"tag": "0004_add_default_span_label_types",
"breakpoints": true
}
]
}