fix: bootstrap admin_users table in super-admin seed script
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m11s
CI/CD Pipeline / Security Scanning (push) Successful in 2m25s
CI/CD Pipeline / Lint and Format (push) Has started running
CI/CD Pipeline / Terraform Validation (push) Has been cancelled
CI/CD Pipeline / Kubernetes Validation (push) Has been cancelled
Deploy ChainID 138 / Deploy ChainID 138 (push) Has been cancelled
Validation / validate-genesis (push) Has been cancelled
Validation / validate-terraform (push) Has been cancelled
Validation / validate-kubernetes (push) Has been cancelled
Validation / validate-smart-contracts (push) Has been cancelled
Verify Deployment / Verify Deployment (push) Has been cancelled
Validation / validate-security (push) Failing after 1m21s
Validation / validate-documentation (push) Failing after 20s
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m11s
CI/CD Pipeline / Security Scanning (push) Successful in 2m25s
CI/CD Pipeline / Lint and Format (push) Has started running
CI/CD Pipeline / Terraform Validation (push) Has been cancelled
CI/CD Pipeline / Kubernetes Validation (push) Has been cancelled
Deploy ChainID 138 / Deploy ChainID 138 (push) Has been cancelled
Validation / validate-genesis (push) Has been cancelled
Validation / validate-terraform (push) Has been cancelled
Validation / validate-kubernetes (push) Has been cancelled
Validation / validate-smart-contracts (push) Has been cancelled
Verify Deployment / Verify Deployment (push) Has been cancelled
Validation / validate-security (push) Failing after 1m21s
Validation / validate-documentation (push) Failing after 20s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -64,6 +64,20 @@ if (!databaseUrl) {
|
||||
const client = new pg.Client({ connectionString: databaseUrl });
|
||||
await client.connect();
|
||||
|
||||
await client.query(`
|
||||
CREATE TABLE IF NOT EXISTS admin_users (
|
||||
id SERIAL PRIMARY KEY,
|
||||
username VARCHAR(255) UNIQUE NOT NULL,
|
||||
email VARCHAR(255),
|
||||
password_hash TEXT NOT NULL,
|
||||
role VARCHAR(50) NOT NULL DEFAULT 'admin',
|
||||
is_active BOOLEAN DEFAULT true,
|
||||
last_login TIMESTAMPTZ,
|
||||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
`);
|
||||
|
||||
for (const { admin, password, hash } of rows) {
|
||||
await client.query(
|
||||
`INSERT INTO admin_users (username, email, password_hash, role, is_active)
|
||||
|
||||
Reference in New Issue
Block a user