Some checks failed
Dev Build / build-test (pull_request) Failing after 1m38s
- Add migration 000001: initial schema with all lookup tables, core entities, and app settings table - Add migration 000002: seed data for printer types, job statuses, material bases, finishes, modifiers, and default settings - Add Go model structs in internal/models with json tags and pointer types for nullable fields - Add go.mod with pgx dependency Key decisions: - FK ON DELETE: RESTRICT on material_base/finish/printer, SET NULL on optional parents (modifier, spool on print_jobs), CASCADE for usage_logs - Soft-delete (deleted_at) on spools and print_jobs - Lookup tables for printer_type and job_status (no raw enums) - Partial indexes for active spools, barcode scans, low-stock queries - Settings table with JSONB values for flexible app config - All identifiers snake_case
20 lines
669 B
PL/PgSQL
20 lines
669 B
PL/PgSQL
-- Migration: 000001_initial_schema (rollback)
|
|
-- Description: Drop all tables and indexes created in the initial schema migration
|
|
-- Author: Hex
|
|
-- Date: 2026-05-06
|
|
|
|
BEGIN;
|
|
|
|
DROP TABLE IF EXISTS usage_logs CASCADE;
|
|
DROP TABLE IF EXISTS print_jobs CASCADE;
|
|
DROP TABLE IF EXISTS filament_spools CASCADE;
|
|
DROP TABLE IF EXISTS printers CASCADE;
|
|
DROP TABLE IF EXISTS settings CASCADE;
|
|
DROP TABLE IF EXISTS material_modifiers CASCADE;
|
|
DROP TABLE IF EXISTS material_finishes CASCADE;
|
|
DROP TABLE IF EXISTS material_bases CASCADE;
|
|
DROP TABLE IF EXISTS job_statuses CASCADE;
|
|
DROP TABLE IF EXISTS printer_types CASCADE;
|
|
|
|
COMMIT;
|