-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
301 additions
and
52 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
16 changes: 11 additions & 5 deletions
16
cmd/cloudcore-server/database/cockroachdb/migrations/1_cloudcore.down.sql
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
DROP TABLE "agents"; | ||
DROP TABLE "hosts"; | ||
DROP TYPE "status"; | ||
DROP TABLE IF EXISTS "agent_group_psk"; | ||
DROP TABLE IF EXISTS "agent_group_member"; | ||
DROP TABLE IF EXISTS "agent_group"; | ||
DROP TABLE IF EXISTS "agent_psk"; | ||
DROP TABLE IF EXISTS "agent"; | ||
DROP TABLE IF EXISTS "host"; | ||
DROP TABLE IF EXISTS "project"; | ||
DROP TABLE IF EXISTS "tenant"; | ||
DROP TYPE IF EXISTS "status"; | ||
|
||
DROP TABLE "schema_migrations"; | ||
DROP TABLE "schema_lock"; | ||
DROP TABLE IF EXISTS "schema_migrations"; | ||
DROP TABLE IF EXISTS "schema_lock"; |
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
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
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
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,28 @@ | ||
package types | ||
|
||
import ( | ||
"database/sql" | ||
"time" | ||
) | ||
|
||
type PreSharedKey struct { | ||
ID string `db:"id"` | ||
CreatedAt time.Time `db:"created_at"` | ||
UpdatedAt time.Time `db:"updated_at"` | ||
Status Status `db:"status"` | ||
ProjectID string `db:"project_id"` | ||
Name string `db:"name"` | ||
Key string `db:"key"` | ||
UsesRemaining int32 `db:"uses_remaining"` | ||
Expiration sql.NullTime `db:"expiration"` | ||
} | ||
|
||
type AgentGroup struct { | ||
ID string `db:"id"` | ||
CreatedAt time.Time `db:"created_at"` | ||
UpdatedAt time.Time `db:"updated_at"` | ||
Status Status `db:"status"` | ||
ProjectID string `db:"project_id"` | ||
Name string `db:"name"` | ||
Description sql.NullString `db:"description"` | ||
} |
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,8 @@ | ||
package types | ||
|
||
type Status string | ||
|
||
const ( | ||
StatusActive = "active" | ||
StatusDeleted = "deleted" | ||
) |
Oops, something went wrong.