Skip to content

Commit

Permalink
Merge pull request #319 from dfpc-coe/ephemeral
Browse files Browse the repository at this point in the history
Layer Ephemeral Store
  • Loading branch information
ingalls authored Sep 4, 2024
2 parents 2a0d526 + 211dd6c commit 2b0676f
Show file tree
Hide file tree
Showing 11 changed files with 4,169 additions and 57 deletions.
2 changes: 2 additions & 0 deletions api/lib/models/Layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const AugmentedLayer = Type.Object({
connection: Type.Optional(Type.Integer()),
cron: Type.String(),
environment: Type.Any(),
ephemeral: Type.Record(Type.String(), Type.String()),
config: Layer_Config,
memory: Type.Integer(),
timeout: Type.Integer(),
Expand Down Expand Up @@ -69,6 +70,7 @@ export default class LayerModel extends Modeler<typeof Layer> {
connection: Layer.connection,
cron: Layer.cron,
environment: Layer.environment,
ephemeral: Layer.ephemeral,
config: Layer.config,
memory: Layer.memory,
timeout: Layer.timeout,
Expand Down
1 change: 1 addition & 0 deletions api/lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export const Layer = pgTable('layers', {
connection: integer('connection').notNull().references(() => Connection.id),
cron: text('cron').notNull(),
environment: json('environment').notNull().default({}),
ephemeral: json('ephemeral').$type<Record<string, string>>().notNull().default({}),
config: json('config').$type<Static<typeof Layer_Config>>().notNull().default({}),
memory: integer('memory').notNull().default(128),
timeout: integer('timeout').notNull().default(128),
Expand Down
6 changes: 6 additions & 0 deletions api/migrations/0057_stale_rogue.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE "data" ALTER COLUMN "mission_groups" SET DEFAULT '{}';--> statement-breakpoint
UPDATE profile
SET phone = ''
WHERE phone IS NULL;
ALTER TABLE "profile" ALTER COLUMN "phone" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "profile" ALTER COLUMN "agency_admin" SET NOT NULL;
1 change: 1 addition & 0 deletions api/migrations/0058_left_secret_warriors.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "layers" ADD COLUMN "ephemeral" json DEFAULT '{}'::json NOT NULL;
Loading

0 comments on commit 2b0676f

Please sign in to comment.