mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2025-04-09 03:21:02 +02:00
25 lines
476 B
Go
25 lines
476 B
Go
package postgres
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
)
|
|
|
|
func incrementalMigration(dbPool *pgxpool.Pool) error {
|
|
_, err := dbPool.Exec(context.Background(), `
|
|
CREATE TABLE IF NOT EXISTS keystore (
|
|
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
|
public_key TEXT NOT NULL,
|
|
private_key TEXT NOT NULL,
|
|
activated BOOLEAN DEFAULT false,
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
`)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|