Skip to content

chore: remove v2 models from schema #2107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions apps/webapp/app/database-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {
BatchTaskRunItemStatus as BatchTaskRunItemStatusType,
TaskRunAttemptStatus as TaskRunAttemptStatusType,
TaskRunStatus as TaskRunStatusType,
JobRunStatus as JobRunStatusType,
RuntimeEnvironmentType as RuntimeEnvironmentTypeType,
} from "@trigger.dev/database";

Expand Down Expand Up @@ -46,24 +45,6 @@ export const TaskRunStatus = {
TIMED_OUT: "TIMED_OUT",
} as const satisfies Record<TaskRunStatusType, TaskRunStatusType>;

export const JobRunStatus = {
PENDING: "PENDING",
QUEUED: "QUEUED",
WAITING_ON_CONNECTIONS: "WAITING_ON_CONNECTIONS",
PREPROCESSING: "PREPROCESSING",
STARTED: "STARTED",
EXECUTING: "EXECUTING",
WAITING_TO_CONTINUE: "WAITING_TO_CONTINUE",
WAITING_TO_EXECUTE: "WAITING_TO_EXECUTE",
SUCCESS: "SUCCESS",
FAILURE: "FAILURE",
TIMED_OUT: "TIMED_OUT",
ABORTED: "ABORTED",
CANCELED: "CANCELED",
UNRESOLVED_AUTH: "UNRESOLVED_AUTH",
INVALID_PAYLOAD: "INVALID_PAYLOAD",
} as const satisfies Record<JobRunStatusType, JobRunStatusType>;

export const RuntimeEnvironmentType = {
PRODUCTION: "PRODUCTION",
STAGING: "STAGING",
Expand Down
14 changes: 0 additions & 14 deletions apps/webapp/app/services/platform.v3.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,6 @@ export async function getCurrentPlan(orgId: string) {
firstDayOfNextMonth.setUTCMonth(firstDayOfNextMonth.getUTCMonth() + 1);
firstDayOfNextMonth.setUTCHours(0, 0, 0, 0);

const currentRunCount = await $replica.jobRun.count({
where: {
organizationId: orgId,
createdAt: {
gte: firstDayOfMonth,
},
},
});

if (!result.success) {
logger.error("Error getting current plan", { orgId, error: result.error });
return undefined;
Expand All @@ -212,11 +203,6 @@ export async function getCurrentPlan(orgId: string) {
const periodRemainingDuration = periodEnd.getTime() - new Date().getTime();

const usage = {
currentRunCount,
runCountCap: result.subscription?.plan.runs?.freeAllowance,
exceededRunCount: result.subscription?.plan.runs?.freeAllowance
? currentRunCount > result.subscription?.plan.runs?.freeAllowance
: false,
periodStart,
periodEnd,
periodRemainingDuration,
Expand Down
2 changes: 0 additions & 2 deletions apps/webapp/app/services/telemetry.server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Job } from "@trigger.dev/database";
import { PostHog } from "posthog-node";
import { env } from "~/env.server";
import { MatchedOrganization } from "~/hooks/useOrganizations";
Expand Down Expand Up @@ -145,7 +144,6 @@ class Telemetry {
},
});
},
deletedJob: ({ job }: { job: Job }) => {},
};

#capture(event: CaptureEvent) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
Warnings:

- You are about to drop the `JobCounter` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `WebhookDeliveryCounter` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `ApiIntegrationVote` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `ConnectionAttempt` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `DeferredScheduledEventService` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `DynamicTriggerRegistration` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `EndpointIndex` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `EventExample` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `HttpSourceRequestDelivery` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `JobAlias` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `JobIntegration` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `JobRunAutoYieldExecution` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `JobRunStatusRecord` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `JobRunSubscription` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `KeyValueItem` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `MissingConnection` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `TaskAttempt` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `TriggerSourceOption` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `WebhookRequestDelivery` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `_JobRunToMissingConnection` table. If the table is not empty, all the data it contains will be lost.

*/

-- DropTable
DROP TABLE IF EXISTS "JobCounter";

-- DropTable
DROP TABLE IF EXISTS "WebhookDeliveryCounter";

-- DropTable
DROP TABLE IF EXISTS "ApiIntegrationVote";

-- DropTable
DROP TABLE IF EXISTS "ConnectionAttempt";

-- DropTable
DROP TABLE IF EXISTS "DeferredScheduledEventService";

-- DropTable
DROP TABLE IF EXISTS "DynamicTriggerRegistration";

-- DropTable
DROP TABLE IF EXISTS "EndpointIndex";

-- DropTable
DROP TABLE IF EXISTS "EventExample";

-- DropTable
DROP TABLE IF EXISTS "HttpSourceRequestDelivery";

-- DropTable
DROP TABLE IF EXISTS "JobAlias";

-- DropTable
DROP TABLE IF EXISTS "JobIntegration";

-- DropTable
DROP TABLE IF EXISTS "JobRunAutoYieldExecution";

-- DropTable
DROP TABLE IF EXISTS "JobRunStatusRecord";

-- DropTable
DROP TABLE IF EXISTS "JobRunSubscription";

-- DropTable
DROP TABLE IF EXISTS "KeyValueItem";

-- DropTable
DROP TABLE IF EXISTS "MissingConnection" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "TaskAttempt";

-- DropTable
DROP TABLE IF EXISTS "TriggerSourceOption";

-- DropTable
DROP TABLE IF EXISTS "WebhookRequestDelivery";

-- DropTable
DROP TABLE IF EXISTS "_JobRunToMissingConnection";

-- DropEnum
DROP TYPE IF EXISTS "EndpointIndexSource";

-- DropEnum
DROP TYPE IF EXISTS "EndpointIndexStatus";

-- DropEnum
DROP TYPE IF EXISTS "JobRunSubscriptionEvents";

-- DropEnum
DROP TYPE IF EXISTS "JobRunSubscriptionRecipientMethod";

-- DropEnum
DROP TYPE IF EXISTS "JobRunSubscriptionStatus";

-- DropEnum
DROP TYPE IF EXISTS "TaskAttemptStatus";
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Warnings:

- You are about to drop the `JobRunExecution` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `ScheduleSource` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `WebhookEnvironment` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropTable
DROP TABLE IF EXISTS "JobRunExecution" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "ScheduleSource" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "WebhookEnvironment" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:

- You are about to drop the column `httpEndpointEnvironmentId` on the `EventRecord` table. All the data in the column will be lost.
- You are about to drop the `TriggerHttpEndpointEnvironment` table. If the table is not empty, all the data it contains will be lost.

*/
-- AlterTable
ALTER TABLE "EventRecord" DROP COLUMN IF EXISTS "httpEndpointEnvironmentId" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "TriggerHttpEndpointEnvironment" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:

- You are about to drop the `Task` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Webhook` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropTable
DROP TABLE IF EXISTS "Task" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "Webhook" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
Warnings:

- You are about to drop the `RunConnection` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `TriggerSource` table. If the table is not empty, all the data it contains will be lost.

*/

-- DropTable
DROP TABLE IF EXISTS "RunConnection" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "TriggerSource" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- You are about to drop the `IntegrationConnection` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropTable
DROP TABLE IF EXISTS "IntegrationConnection" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Warnings:

- You are about to drop the `DynamicTrigger` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `EventDispatcher` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `EventRecord` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `JobRun` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `_DynamicTriggerToJob` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropTable
DROP TABLE IF EXISTS "DynamicTrigger" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "EventDispatcher" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "EventRecord" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "JobRun" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "_DynamicTriggerToJob" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:

- You are about to drop the `JobVersion` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `TriggerHttpEndpoint` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropTable
DROP TABLE IF EXISTS "JobVersion" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "TriggerHttpEndpoint" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Warnings:

- You are about to drop the `ConcurrencyLimitGroup` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Endpoint` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Job` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `JobQueue` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropTable
DROP TABLE IF EXISTS "ConcurrencyLimitGroup" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "Endpoint" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "Job" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "JobQueue" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Warnings:

- You are about to drop the `ExternalAccount` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Integration` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `IntegrationAuthMethod` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `IntegrationDefinition` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropTable
DROP TABLE IF EXISTS "ExternalAccount" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "Integration" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "IntegrationAuthMethod" CASCADE;

-- DropTable
DROP TABLE IF EXISTS "IntegrationDefinition" CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-- DropEnum
DROP TYPE IF EXISTS "ConnectionType";

-- DropEnum
DROP TYPE IF EXISTS "DynamicTriggerType";

-- DropEnum
DROP TYPE IF EXISTS "IntegrationAuthSource";

-- DropEnum
DROP TYPE IF EXISTS "IntegrationSetupStatus";

-- DropEnum
DROP TYPE IF EXISTS "JobRunExecutionReason";

-- DropEnum
DROP TYPE IF EXISTS "JobRunExecutionStatus";

-- DropEnum
DROP TYPE IF EXISTS "JobRunStatus";

-- DropEnum
DROP TYPE IF EXISTS "JobStartPosition";

-- DropEnum
DROP TYPE IF EXISTS "JobVersionStatus";

-- DropEnum
DROP TYPE IF EXISTS "PayloadType";

-- DropEnum
DROP TYPE IF EXISTS "TaskChildExecutionMode";

-- DropEnum
DROP TYPE IF EXISTS "TaskStatus";

-- DropEnum
DROP TYPE IF EXISTS "TriggerChannel";
Loading