Rebuild: fresh AdonisJS 7 API app on Postgres
The rebuild branch starts over (REBUILD.md): the API starter kit, with Postgres instead of SQLite (its own database, DB_SEARCH_PATH for a shared one in development) and the #lib alias. Phase 1's code is imported from the current app module by module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
699395c51f
commit
96f0ade10e
264 files changed
+777
-24132
No files matched your search
@@ -1,4 +0,0 @@
|
||||
import { BaseModel as AdonisBaseModel } from '@adonisjs/lucid/orm'
|
||||
|
||||
export default class BaseModel extends AdonisBaseModel {
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { column } from '@adonisjs/lucid/orm'
|
||||
import BaseModel from '#models/base_model'
|
||||
import { loadedSegments, storedSegments } from '#services/FileStore'
|
||||
import type { Segment } from '#lib/nzb/index'
|
||||
|
||||
export default class File extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
declare id: number
|
||||
|
||||
@column({ columnName: 'file_key' })
|
||||
declare fileKey: string | null
|
||||
|
||||
@column()
|
||||
declare filename: string
|
||||
|
||||
@column()
|
||||
declare poster: string
|
||||
|
||||
@column()
|
||||
declare date: number
|
||||
|
||||
@column()
|
||||
declare parts: number
|
||||
|
||||
/** Stored compressed (see FileStore); the model sees the list. */
|
||||
@column({ prepare: (value: Segment[]) => storedSegments(value), consume: (value: Buffer | null) => loadedSegments(value) })
|
||||
declare segments: Segment[]
|
||||
|
||||
@column({ columnName: 'first_message_id' })
|
||||
declare firstMessageId: string | null
|
||||
|
||||
@column()
|
||||
declare groups: string[]
|
||||
|
||||
@column.dateTime({ autoCreate: true })
|
||||
declare createdAt: DateTime
|
||||
|
||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
||||
declare updatedAt: DateTime
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { column } from '@adonisjs/lucid/orm'
|
||||
import BaseModel from '#models/base_model'
|
||||
|
||||
export default class Group extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
declare id: number
|
||||
|
||||
@column()
|
||||
declare name: string
|
||||
|
||||
@column()
|
||||
declare active: boolean
|
||||
|
||||
/** Every article up to here was fetched successfully (see FetchRangeService). */
|
||||
@column({ columnName: 'last_indexed_id' })
|
||||
declare lastIndexedId: bigint
|
||||
|
||||
/** Download bodies of obfuscated articles to identify them (bandwidth-heavy). */
|
||||
@column({ columnName: 'fetch_bodies' })
|
||||
declare fetchBodies: boolean
|
||||
|
||||
/** How far the scheduler has queued fetch jobs. */
|
||||
@column({ columnName: 'last_queued_id' })
|
||||
declare lastQueuedId: bigint
|
||||
|
||||
@column.dateTime({ autoCreate: true })
|
||||
declare createdAt: DateTime
|
||||
|
||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
||||
declare updatedAt: DateTime
|
||||
}
|
||||
Reference in new issue
Block a user