mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-22 20:41:40 +02:00
Add node table schema
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/golang-migrate/migrate/v4/source/iofs"
|
||||
)
|
||||
|
||||
const Version uint = 9
|
||||
const Version uint = 10
|
||||
|
||||
//go:embed migrations/*
|
||||
var migrationFiles embed.FS
|
||||
|
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS node;
|
17
internal/repository/migrations/sqlite3/10_node-table.up.sql
Normal file
17
internal/repository/migrations/sqlite3/10_node-table.up.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE "node" (
|
||||
id INTEGER PRIMARY KEY,
|
||||
hostname VARCHAR(255) NOT NULL,
|
||||
cluster VARCHAR(255) NOT NULL,
|
||||
subcluster VARCHAR(255) NOT NULL,
|
||||
node_state VARCHAR(255) NOT NULL
|
||||
CHECK (job_state IN (
|
||||
'allocated', 'reserved', 'idle', 'mixed',
|
||||
'down', 'unknown'
|
||||
)),
|
||||
health_state VARCHAR(255) NOT NULL
|
||||
CHECK (job_state IN (
|
||||
'full', 'partial', 'failed'
|
||||
)),
|
||||
meta_data TEXT, -- JSON
|
||||
UNIQUE (hostname, cluster)
|
||||
);
|
Reference in New Issue
Block a user