simulationScenarios (schema/simulations.ts)

stripemeter · packages/database/src/schema/simulations.ts · typescript · MIT
database

Defines database tables and relations for simulation scenarios, runs, and batches used in pricing tests.

// Source: https://github.com/louispy/stripemeter | License: MIT | Copyright 2025 StripeMeter Contributors
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Database schema for simulation scenarios and runs
 */

import { pgTable, uuid, text, timestamp, jsonb, varchar, index, boolean, integer } from 'drizzle-orm/pg-core';
import { relations } from 'drizzle-orm';

/**
 * Simulation scenarios - reusable pricing configurations for testing
 */
export const simulationScenarios = pgTable('simulation_scenarios', {
  id: uuid('id').primaryKey().defaultRandom(),
  tenantId: uuid('tenant_id').notNull(),
  
  // Scenario metadata
  name: varchar('name', { length: 255 }).notNull(),
  description: text('description'),
  version: varchar('version', { length: 50 }).notNull().default(

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key