Your music, beautifully tracked. All yours. (coming soon) teal.fm
teal-fm atproto

update db schema to match lexicon

+391 -4
+25
packages/db/.drizzle/0006_supreme_hairball.sql
··· 1 + PRAGMA foreign_keys=OFF;--> statement-breakpoint 2 + CREATE TABLE `__new_play` ( 3 + `uri` text PRIMARY KEY NOT NULL, 4 + `author_did` text NOT NULL, 5 + `created_at` text NOT NULL, 6 + `indexed_at` text NOT NULL, 7 + `track_name` text NOT NULL, 8 + `track_mb_id` text, 9 + `recording_mb_id` text, 10 + `duration` integer, 11 + `artist_names` text, 12 + `artist_mb_ids` text, 13 + `release_name` text, 14 + `release_mb_id` text, 15 + `isrc` text, 16 + `origin_url` text, 17 + `music_service_base_domain` text, 18 + `submission_client_agent` text, 19 + `played_time` text 20 + ); 21 + --> statement-breakpoint 22 + INSERT INTO `__new_play`("uri", "author_did", "created_at", "indexed_at", "track_name", "track_mb_id", "recording_mb_id", "duration", "artist_names", "artist_mb_ids", "release_name", "release_mb_id", "isrc", "origin_url", "music_service_base_domain", "submission_client_agent", "played_time") SELECT "uri", "author_did", "created_at", "indexed_at", "track_name", "track_mb_id", "recording_mb_id", "duration", "artist_name", "artist_mb_ids", "release_name", "release_mb_id", "isrc", "origin_url", "music_service_base_domain", "submission_client_agent", "played_time" FROM `play`;--> statement-breakpoint 23 + DROP TABLE `play`;--> statement-breakpoint 24 + ALTER TABLE `__new_play` RENAME TO `play`;--> statement-breakpoint 25 + PRAGMA foreign_keys=ON;
+356
packages/db/.drizzle/meta/0006_snapshot.json
··· 1 + { 2 + "version": "6", 3 + "dialect": "sqlite", 4 + "id": "ff3fcc45-0760-4f6d-8f7c-659a1ee80ed5", 5 + "prevId": "42a94e7a-c4c2-4bd5-92d9-ba8a829c0704", 6 + "tables": { 7 + "atp_session": { 8 + "name": "atp_session", 9 + "columns": { 10 + "key": { 11 + "name": "key", 12 + "type": "text", 13 + "primaryKey": true, 14 + "notNull": true, 15 + "autoincrement": false 16 + }, 17 + "session": { 18 + "name": "session", 19 + "type": "text", 20 + "primaryKey": false, 21 + "notNull": true, 22 + "autoincrement": false 23 + } 24 + }, 25 + "indexes": {}, 26 + "foreignKeys": {}, 27 + "compositePrimaryKeys": {}, 28 + "uniqueConstraints": {}, 29 + "checkConstraints": {} 30 + }, 31 + "auth_state": { 32 + "name": "auth_state", 33 + "columns": { 34 + "key": { 35 + "name": "key", 36 + "type": "text", 37 + "primaryKey": true, 38 + "notNull": true, 39 + "autoincrement": false 40 + }, 41 + "state": { 42 + "name": "state", 43 + "type": "text", 44 + "primaryKey": false, 45 + "notNull": true, 46 + "autoincrement": false 47 + } 48 + }, 49 + "indexes": {}, 50 + "foreignKeys": {}, 51 + "compositePrimaryKeys": {}, 52 + "uniqueConstraints": {}, 53 + "checkConstraints": {} 54 + }, 55 + "follow": { 56 + "name": "follow", 57 + "columns": { 58 + "rel_id": { 59 + "name": "rel_id", 60 + "type": "text", 61 + "primaryKey": true, 62 + "notNull": true, 63 + "autoincrement": false 64 + }, 65 + "follower": { 66 + "name": "follower", 67 + "type": "text", 68 + "primaryKey": false, 69 + "notNull": true, 70 + "autoincrement": false 71 + }, 72 + "followed": { 73 + "name": "followed", 74 + "type": "text", 75 + "primaryKey": false, 76 + "notNull": true, 77 + "autoincrement": false 78 + }, 79 + "created_at": { 80 + "name": "created_at", 81 + "type": "text", 82 + "primaryKey": false, 83 + "notNull": true, 84 + "autoincrement": false 85 + } 86 + }, 87 + "indexes": {}, 88 + "foreignKeys": {}, 89 + "compositePrimaryKeys": {}, 90 + "uniqueConstraints": {}, 91 + "checkConstraints": {} 92 + }, 93 + "play": { 94 + "name": "play", 95 + "columns": { 96 + "uri": { 97 + "name": "uri", 98 + "type": "text", 99 + "primaryKey": true, 100 + "notNull": true, 101 + "autoincrement": false 102 + }, 103 + "author_did": { 104 + "name": "author_did", 105 + "type": "text", 106 + "primaryKey": false, 107 + "notNull": true, 108 + "autoincrement": false 109 + }, 110 + "created_at": { 111 + "name": "created_at", 112 + "type": "text", 113 + "primaryKey": false, 114 + "notNull": true, 115 + "autoincrement": false 116 + }, 117 + "indexed_at": { 118 + "name": "indexed_at", 119 + "type": "text", 120 + "primaryKey": false, 121 + "notNull": true, 122 + "autoincrement": false 123 + }, 124 + "track_name": { 125 + "name": "track_name", 126 + "type": "text", 127 + "primaryKey": false, 128 + "notNull": true, 129 + "autoincrement": false 130 + }, 131 + "track_mb_id": { 132 + "name": "track_mb_id", 133 + "type": "text", 134 + "primaryKey": false, 135 + "notNull": false, 136 + "autoincrement": false 137 + }, 138 + "recording_mb_id": { 139 + "name": "recording_mb_id", 140 + "type": "text", 141 + "primaryKey": false, 142 + "notNull": false, 143 + "autoincrement": false 144 + }, 145 + "duration": { 146 + "name": "duration", 147 + "type": "integer", 148 + "primaryKey": false, 149 + "notNull": false, 150 + "autoincrement": false 151 + }, 152 + "artist_names": { 153 + "name": "artist_names", 154 + "type": "text", 155 + "primaryKey": false, 156 + "notNull": false, 157 + "autoincrement": false 158 + }, 159 + "artist_mb_ids": { 160 + "name": "artist_mb_ids", 161 + "type": "text", 162 + "primaryKey": false, 163 + "notNull": false, 164 + "autoincrement": false 165 + }, 166 + "release_name": { 167 + "name": "release_name", 168 + "type": "text", 169 + "primaryKey": false, 170 + "notNull": false, 171 + "autoincrement": false 172 + }, 173 + "release_mb_id": { 174 + "name": "release_mb_id", 175 + "type": "text", 176 + "primaryKey": false, 177 + "notNull": false, 178 + "autoincrement": false 179 + }, 180 + "isrc": { 181 + "name": "isrc", 182 + "type": "text", 183 + "primaryKey": false, 184 + "notNull": false, 185 + "autoincrement": false 186 + }, 187 + "origin_url": { 188 + "name": "origin_url", 189 + "type": "text", 190 + "primaryKey": false, 191 + "notNull": false, 192 + "autoincrement": false 193 + }, 194 + "music_service_base_domain": { 195 + "name": "music_service_base_domain", 196 + "type": "text", 197 + "primaryKey": false, 198 + "notNull": false, 199 + "autoincrement": false 200 + }, 201 + "submission_client_agent": { 202 + "name": "submission_client_agent", 203 + "type": "text", 204 + "primaryKey": false, 205 + "notNull": false, 206 + "autoincrement": false 207 + }, 208 + "played_time": { 209 + "name": "played_time", 210 + "type": "text", 211 + "primaryKey": false, 212 + "notNull": false, 213 + "autoincrement": false 214 + } 215 + }, 216 + "indexes": {}, 217 + "foreignKeys": {}, 218 + "compositePrimaryKeys": {}, 219 + "uniqueConstraints": {}, 220 + "checkConstraints": {} 221 + }, 222 + "status": { 223 + "name": "status", 224 + "columns": { 225 + "uri": { 226 + "name": "uri", 227 + "type": "text", 228 + "primaryKey": true, 229 + "notNull": true, 230 + "autoincrement": false 231 + }, 232 + "author_did": { 233 + "name": "author_did", 234 + "type": "text", 235 + "primaryKey": false, 236 + "notNull": true, 237 + "autoincrement": false 238 + }, 239 + "status": { 240 + "name": "status", 241 + "type": "text", 242 + "primaryKey": false, 243 + "notNull": true, 244 + "autoincrement": false 245 + }, 246 + "created_at": { 247 + "name": "created_at", 248 + "type": "text", 249 + "primaryKey": false, 250 + "notNull": true, 251 + "autoincrement": false 252 + }, 253 + "indexed_at": { 254 + "name": "indexed_at", 255 + "type": "text", 256 + "primaryKey": false, 257 + "notNull": true, 258 + "autoincrement": false 259 + } 260 + }, 261 + "indexes": {}, 262 + "foreignKeys": {}, 263 + "compositePrimaryKeys": {}, 264 + "uniqueConstraints": {}, 265 + "checkConstraints": {} 266 + }, 267 + "teal_session": { 268 + "name": "teal_session", 269 + "columns": { 270 + "key": { 271 + "name": "key", 272 + "type": "text", 273 + "primaryKey": true, 274 + "notNull": true, 275 + "autoincrement": false 276 + }, 277 + "session": { 278 + "name": "session", 279 + "type": "text", 280 + "primaryKey": false, 281 + "notNull": true, 282 + "autoincrement": false 283 + }, 284 + "provider": { 285 + "name": "provider", 286 + "type": "text", 287 + "primaryKey": false, 288 + "notNull": true, 289 + "autoincrement": false 290 + } 291 + }, 292 + "indexes": {}, 293 + "foreignKeys": {}, 294 + "compositePrimaryKeys": {}, 295 + "uniqueConstraints": {}, 296 + "checkConstraints": {} 297 + }, 298 + "teal_user": { 299 + "name": "teal_user", 300 + "columns": { 301 + "did": { 302 + "name": "did", 303 + "type": "text", 304 + "primaryKey": true, 305 + "notNull": true, 306 + "autoincrement": false 307 + }, 308 + "handle": { 309 + "name": "handle", 310 + "type": "text", 311 + "primaryKey": false, 312 + "notNull": true, 313 + "autoincrement": false 314 + }, 315 + "avatar": { 316 + "name": "avatar", 317 + "type": "text", 318 + "primaryKey": false, 319 + "notNull": true, 320 + "autoincrement": false 321 + }, 322 + "bio": { 323 + "name": "bio", 324 + "type": "text", 325 + "primaryKey": false, 326 + "notNull": false, 327 + "autoincrement": false 328 + }, 329 + "created_at": { 330 + "name": "created_at", 331 + "type": "text", 332 + "primaryKey": false, 333 + "notNull": true, 334 + "autoincrement": false 335 + } 336 + }, 337 + "indexes": {}, 338 + "foreignKeys": {}, 339 + "compositePrimaryKeys": {}, 340 + "uniqueConstraints": {}, 341 + "checkConstraints": {} 342 + } 343 + }, 344 + "views": {}, 345 + "enums": {}, 346 + "_meta": { 347 + "schemas": {}, 348 + "tables": {}, 349 + "columns": { 350 + "\"play\".\"artist_name\"": "\"play\".\"artist_names\"" 351 + } 352 + }, 353 + "internal": { 354 + "indexes": {} 355 + } 356 + }
+7
packages/db/.drizzle/meta/_journal.json
··· 43 43 "when": 1735497040757, 44 44 "tag": "0005_conscious_johnny_blaze", 45 45 "breakpoints": true 46 + }, 47 + { 48 + "idx": 6, 49 + "version": "6", 50 + "when": 1736372650928, 51 + "tag": "0006_supreme_hairball", 52 + "breakpoints": true 46 53 } 47 54 ] 48 55 }
+2 -2
packages/db/schema.ts
··· 76 76 recordingMbId: text(), 77 77 /** The length of the track in seconds */ 78 78 duration: integer(), 79 - /** The name of the artist */ 80 - artistName: text().notNull(), 79 + /** The names of the artists in order of original appearance */ 80 + artistNames: json<string[]>(), 81 81 /** Array of Musicbrainz artist IDs */ 82 82 // type of string[] 83 83 artistMbIds: json<string[]>(),
+1 -2
packages/jetstring/src/index.ts
··· 58 58 // the AT path 59 59 uri: record.commit.rkey, 60 60 authorDid: record.did, 61 - 62 - artistName: msg.artistName, 61 + artistNames: msg.artistNames, 63 62 trackName: msg.trackName, 64 63 artistMbIds: msg.artistMbIds || [], 65 64 trackMbId: msg.trackMbId || "",