feat(tasks): allow management of job intervals and disabling them (#3408)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
CREATE TABLE `cron_job_configuration` (
|
||||
`name` varchar(256) NOT NULL,
|
||||
`cron_expression` varchar(32) NOT NULL,
|
||||
`is_enabled` boolean NOT NULL DEFAULT true,
|
||||
CONSTRAINT `cron_job_configuration_name` PRIMARY KEY(`name`)
|
||||
);
|
||||
2093
packages/db/migrations/mysql/meta/0033_snapshot.json
Normal file
2093
packages/db/migrations/mysql/meta/0033_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -232,6 +232,13 @@
|
||||
"when": 1746821770071,
|
||||
"tag": "0032_add_trusted_certificate_hostnames",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 33,
|
||||
"version": "5",
|
||||
"when": 1750013953833,
|
||||
"tag": "0033_add_cron_job_configuration",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE `cron_job_configuration` (
|
||||
`name` text PRIMARY KEY NOT NULL,
|
||||
`cron_expression` text NOT NULL,
|
||||
`is_enabled` integer DEFAULT true NOT NULL
|
||||
);
|
||||
2008
packages/db/migrations/sqlite/meta/0033_snapshot.json
Normal file
2008
packages/db/migrations/sqlite/meta/0033_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -232,6 +232,13 @@
|
||||
"when": 1746821779051,
|
||||
"tag": "0032_add_trusted_certificate_hostnames",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 33,
|
||||
"version": "6",
|
||||
"when": 1750014001941,
|
||||
"tag": "0033_add_cron_job_configuration",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ export const {
|
||||
itemLayouts,
|
||||
sectionLayouts,
|
||||
trustedCertificateHostnames,
|
||||
cronJobConfigurations,
|
||||
} = schema;
|
||||
|
||||
export type User = InferSelectModel<typeof schema.users>;
|
||||
|
||||
@@ -508,6 +508,12 @@ export const trustedCertificateHostnames = mysqlTable(
|
||||
}),
|
||||
);
|
||||
|
||||
export const cronJobConfigurations = mysqlTable("cron_job_configuration", {
|
||||
name: varchar({ length: 256 }).notNull().primaryKey(),
|
||||
cronExpression: varchar({ length: 32 }).notNull(),
|
||||
isEnabled: boolean().default(true).notNull(),
|
||||
});
|
||||
|
||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||
user: one(users, {
|
||||
fields: [accounts.userId],
|
||||
|
||||
@@ -493,6 +493,12 @@ export const trustedCertificateHostnames = sqliteTable(
|
||||
}),
|
||||
);
|
||||
|
||||
export const cronJobConfigurations = sqliteTable("cron_job_configuration", {
|
||||
name: text().notNull().primaryKey(),
|
||||
cronExpression: text().notNull(),
|
||||
isEnabled: int({ mode: "boolean" }).default(true).notNull(),
|
||||
});
|
||||
|
||||
export const accountRelations = relations(accounts, ({ one }) => ({
|
||||
user: one(users, {
|
||||
fields: [accounts.userId],
|
||||
|
||||
Reference in New Issue
Block a user