-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: nyagamunene <[email protected]>
- Loading branch information
1 parent
bdaaa5f
commit c40b718
Showing
7 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Abstract Machines | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package postgres | ||
|
||
import ( | ||
_ "github.com/jackc/pgx/v5/stdlib" | ||
migrate "github.com/rubenv/sql-migrate" | ||
) | ||
|
||
func Migration() *migrate.MemoryMigrationSource { | ||
return &migrate.MemoryMigrationSource{ | ||
Migrations: []*migrate.Migration{ | ||
{ | ||
Id: "certs_1", | ||
Up: []string{ | ||
`CREATE TABLE IF NOT EXISTS certs ( | ||
serial_number VARCHAR(40) UNIQUE NOT NULL, | ||
certificate TEXT, | ||
key TEXT, | ||
revoked BOOLEAN, | ||
expiry_time TIMESTAMP, | ||
entity_id VARCHAR(36), | ||
type TEXT CHECK (type IN ('RootCA', 'IntermediateCA', 'ClientCert')), | ||
PRIMARY KEY (serial_number) | ||
)`, | ||
}, | ||
Down: []string{ | ||
"DROP TABLE certs", | ||
}, | ||
}, | ||
}, | ||
} | ||
} |