Database diagrams editor that allows you to visualize and design your DB with a single query.
TypeScript databasedbdb-migrationeditorerdmariadbmssqlmysqlpostgresqlreactreact-flowschema-migrationssqlsqlitetypescriptvisualizationxyflow
import { DatabaseType } from '@/lib/domain/database-type';
import type { Template } from '../templates-data';
import image from '@/assets/templates/pay-rails-db.png';
import imageDark from '@/assets/templates/pay-rails-db-dark.png';
const now = Date.now();
export const payRailsDb: Template = {
slug: 'pay-rails-database',
name: 'Pay-Rails',
shortDescription: 'Payments for Ruby on Rails apps',
description:
'Allows you to accept payments from Stripe, Paddle, Braintree, Lemon Squeezy, and more.',
image,
imageDark,
tags: ['Postgres', 'Open Source', 'Rails'],
featured: true,
url: 'https://github.com/pay-rails/pay',
diagram: {
id: 'pay_rails_db',
name: 'pay-rails-database',
createdAt: new Date(),
updatedAt: new Date(),
databaseType: DatabaseType.POSTGRESQL,
tables: [
{
id: '6bcyzessb8ilsjgy01typ2jeb',
name: 'pay_merchants',
schema: 'public',
x: 889.1929564411491,
y: -331.8643188137164,
fields: [
{
id: '8ekvepjc55cftsj1h45hl558z',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default: "nextval('pay_merchants_id_seq'::regclass)",
createdAt: now,
},
{
id: 'cjs9abnqnmgs2q52b5xrwryxb',
name: 'owner_type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'jwnnw10whuupmv38cq7awhdzi',
name: 'owner_id',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'boar043p9e616uj978eg3vxhm',
name: 'processor',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '8ryynbt8i3i98t53jbaz5nalw',
name: 'processor_id',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '22xrohu0rajq9gpw1ancpwcsw',
name: 'default',
type: {
id: 'boolean',
name: 'boolean',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '2u1pmcizr6fvuad4q1lrfh97s',
name: 'data',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'wzhrq6f5x0wnr4y88pdcunons',
name: 'created_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'bzpzc67r80gpd8lqck3d0lbup',
name: 'updated_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'zhfpqp513y4p0qufy0texbmv8',
name: 'type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: 'm7xvsbvju64wgf2zvrdqcdm1h',
name: 'index_pay_merchants_on_owner_type_and_owner_id_and_processor',
unique: false,
fieldIds: [
'cjs9abnqnmgs2q52b5xrwryxb',
'jwnnw10whuupmv38cq7awhdzi',
'boar043p9e616uj978eg3vxhm',
],
createdAt: now,
},
{
id: 'ti2lj97oy2trnkmimh84el31f',
name: 'pay_merchants_pkey',
unique: true,
fieldIds: ['8ekvepjc55cftsj1h45hl558z'],
createdAt: now,
},
],
color: '#7175fa',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'aliqiks5f2gm4du9io27jf1vy',
name: 'pay_charges',
schema: 'public',
x: 540,
y: -340,
fields: [
{
id: 'rxmlheh0hosh2ihr1em9q65nc',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default: "nextval('pay_charges_id_seq'::regclass)",
createdAt: now,
},
{
id: 'pv5smlh4qam1xwyxoq49ncuy8',
name: 'customer_id',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'akm13624gviyp0hv9c2avabm5',
name: 'subscription_id',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'fyfgp04eccrc26sqoe2wnazwj',
name: 'processor_id',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '8gdaxumxkc4oi2h5zndx07x5g',
name: 'amount',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'rlbora1bq97wtbvzguftgld6v',
name: 'currency',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'vg6xo8x1dyyqd7e252lyle9ue',
name: 'application_fee_amount',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '8ahzsr28rkbovn9nfyeb76stq',
name: 'amount_refunded',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '6duiemcip5mc11jv3oueln5vz',
name: 'metadata',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'umgjft3z8y0nis2d1efk3r2ht',
name: 'data',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'hq18d1r3u4xpvwc9ois4zsd8c',
name: 'stripe_account',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '6ryr4lfylm1d9shrj5l33ujnb',
name: 'created_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'hg5evq1b23xa1c25t7gmty8eu',
name: 'updated_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '1kdt1o72szxzqknuakkfnyddk',
name: 'type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: 'v4wkleu4p3u07ldyolbklwdzw',
name: 'index_pay_charges_on_customer_id_and_processor_id',
unique: false,
fieldIds: [
'pv5smlh4qam1xwyxoq49ncuy8',
'fyfgp04eccrc26sqoe2wnazwj',
],
createdAt: now,
},
{
id: 'tjmemqg6g1341anehom2fos0j',
name: 'pay_charges_customer_id_processor_id_key',
unique: true,
fieldIds: [
'pv5smlh4qam1xwyxoq49ncuy8',
'fyfgp04eccrc26sqoe2wnazwj',
],
createdAt: now,
},
{
id: '3xb43ra3n772qv8sjnq39e79c',
name: 'pay_charges_pkey',
unique: true,
fieldIds: ['rxmlheh0hosh2ihr1em9q65nc'],
createdAt: now,
},
{
id: 'ba87tb4w5u47p3zltm4zbdpfw',
name: 'index_pay_charges_on_subscription_id',
unique: false,
fieldIds: ['akm13624gviyp0hv9c2avabm5'],
createdAt: now,
},
],
color: '#ff6b8a',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'eqjebesocq7ajoo07rk40drl9',
name: 'pay_subscriptions',
schema: 'public',
x: 900,
y: 100,
fields: [
{
id: 'olqm3l2frfckpj8twtjj51bs1',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default:
"nextval('pay_subscriptions_id_seq'::regclass)",
createdAt: now,
},
{
id: '1jb9hyb9oqqtxaxkci7f7j2gn',
name: 'customer_id',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'tdp0gw6xuwlkohullyuf39jw9',
name: 'name',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'btl3xxlsojtgcz9hed8nxjzid',
name: 'processor_id',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'bpkhtqlfyt549dm20c6yuldj6',
name: 'processor_plan',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '7bgunf95c1zbx37ymp6hc5voi',
name: 'quantity',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: false,
default: '1',
createdAt: now,
},
{
id: 'x3jzoi19ooept3hrbgvpzsqd9',
name: 'status',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'izdfry8zzyd92rcjp9pa44uuh',
name: 'current_period_start',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 't8beygrt1xdz3lcy2qddgi62d',
name: 'current_period_end',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'ilfyn597rhz19cp2bwsl0elyj',
name: 'trial_ends_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '28219rfe5dwc8vq05crv22gsh',
name: 'ends_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '5jl6bm37miboi2zrum4q0udog',
name: 'application_fee_percent',
type: {
id: 'numeric',
name: 'numeric',
},
primaryKey: false,
unique: false,
nullable: true,
precision: 8,
scale: 2,
createdAt: now,
},
{
id: 'tn6oei4cbgxaf23lt18s3pref',
name: 'metadata',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'uutgo3u8yl81r2f6z24ymywz1',
name: 'data',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '664ukbrqumkp2b5c46s2tpnou',
name: 'stripe_account',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'irtbqq8bgbzhg8issn0a2wlcp',
name: 'created_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'wtlwv3bpujx3tm98u9dzqisxk',
name: 'updated_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'dm5j0n0brqdr7zzkqa0zc4qrq',
name: 'metered',
type: {
id: 'boolean',
name: 'boolean',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'rjmmp8ndbxl6wl1bfa1l8kpjg',
name: 'pause_behavior',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'xqfqazh40b2vjyl2u315h106f',
name: 'pause_starts_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'coywqs1rmcmnobax10wk6l8yu',
name: 'pause_resumes_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'ax6y9oqhaxgfh4u7g1rvxcl61',
name: 'payment_method_id',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'shi1z7x8fyrwqr459mm85k7zp',
name: 'type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: '9n5r4ehe19tsy98xsr32t0q3q',
name: 'index_pay_subscriptions_on_pause_starts_at',
unique: false,
fieldIds: ['xqfqazh40b2vjyl2u315h106f'],
createdAt: now,
},
{
id: 'd4w0jeafmd2vj8ntg5qaz4aoq',
name: 'pay_subscriptions_customer_id_processor_id_key',
unique: true,
fieldIds: [
'1jb9hyb9oqqtxaxkci7f7j2gn',
'btl3xxlsojtgcz9hed8nxjzid',
],
createdAt: now,
},
{
id: '5vjz981yl884oy8u2yfnkqh1x',
name: 'index_pay_subscriptions_on_metered',
unique: false,
fieldIds: ['dm5j0n0brqdr7zzkqa0zc4qrq'],
createdAt: now,
},
{
id: 'khfjtlrxw75mbjf8nsw6ges1d',
name: 'index_pay_subscriptions_on_customer_id_and_processor_id',
unique: false,
fieldIds: [
'1jb9hyb9oqqtxaxkci7f7j2gn',
'btl3xxlsojtgcz9hed8nxjzid',
],
createdAt: now,
},
{
id: 'wrdxny5t8acdny2jjykl75wes',
name: 'pay_subscriptions_pkey',
unique: true,
fieldIds: ['olqm3l2frfckpj8twtjj51bs1'],
createdAt: now,
},
],
color: '#ff6363',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'iqh50zqu2rtdub6coyhpl8y93',
name: 'accounts',
schema: 'public',
x: 507.6441149212235,
y: 678.0900834105653,
fields: [
{
id: 'lpf912z0q91glk9e63eis1cbz',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default: "nextval('accounts_id_seq'::regclass)",
createdAt: now,
},
{
id: 'k3xsgerkvkw2m8329o7ztgqng',
name: 'email',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'lvy55fatssrxjgogewjegbzzn',
name: 'merchant_processor',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'hp9khlfu13rvsds8wgp7qrj9g',
name: 'pay_data',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: '09zkpz9eglkh4lnjs5zj4uikt',
name: 'accounts_pkey',
unique: true,
fieldIds: ['lpf912z0q91glk9e63eis1cbz'],
createdAt: now,
},
],
color: '#b067e9',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'l3x89lp7szr6ycmkac7a5gjut',
name: 'users',
schema: 'public',
x: 636.1453197405006,
y: 446.16051899907313,
fields: [
{
id: '08069jga2me6uemt53tkzg6cw',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default: "nextval('users_id_seq'::regclass)",
createdAt: now,
},
{
id: 'hpoxd919ra7hv1cw9mzkl7lp1',
name: 'email',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'y9u8iasvxmwodltj743co8n7c',
name: 'first_name',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'ckfoudg0zfvi2c1f8rfe5sev8',
name: 'last_name',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'svptfacpd86if34cf0yyrd2ws',
name: 'extra_billing_info',
type: {
id: 'text',
name: 'text',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: 'kr2e0jtsiz4fkrr7y93ctcyqi',
name: 'users_pkey',
unique: true,
fieldIds: ['08069jga2me6uemt53tkzg6cw'],
createdAt: now,
},
],
color: '#ffe374',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'mpqg2uz3opvhby9wjy8oxi3td',
name: 'pay_customers',
schema: 'public',
x: 100,
y: 100,
fields: [
{
id: '3iufciqo18ce5i4mntwrvt5me',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default: "nextval('pay_customers_id_seq'::regclass)",
createdAt: now,
},
{
id: '5t3xq5rno3gimbfzi869ukocl',
name: 'owner_type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'iabfxzhpojdtxtnw8ogstm22m',
name: 'owner_id',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'kmbeskibr3nl3vhhar86u9fym',
name: 'processor',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'y12tz7p1tyntw3ew7zv0i522x',
name: 'processor_id',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'th7bl19u0l6y0bykj3uw836he',
name: 'default',
type: {
id: 'boolean',
name: 'boolean',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'x1onh995pvq5gvv78rh132itc',
name: 'data',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'uqtu07rtfikiskf6pbuim78hx',
name: 'stripe_account',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'yfvvhal5klj38xatp7df7uncc',
name: 'deleted_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'umgmqry8u6xvtb0edwog27gdy',
name: 'created_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '604t0fpqmh1wrwt6oyg66wbnn',
name: 'updated_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '76dqpguhxowzr3s8cbmcugzdx',
name: 'type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: 'ty344crimp7gzq7a1mo16ggk7',
name: 'pay_customers_processor_processor_id_key',
unique: true,
fieldIds: [
'kmbeskibr3nl3vhhar86u9fym',
'y12tz7p1tyntw3ew7zv0i522x',
],
createdAt: now,
},
{
id: '0sm33i3qhqeh3d25cmb3mpw41',
name: 'pay_customer_owner_index',
unique: false,
fieldIds: [
'5t3xq5rno3gimbfzi869ukocl',
'iabfxzhpojdtxtnw8ogstm22m',
'yfvvhal5klj38xatp7df7uncc',
'th7bl19u0l6y0bykj3uw836he',
],
createdAt: now,
},
{
id: '6g161vxyiagbc4h8nhj5yn4ss',
name: 'pay_customers_pkey',
unique: true,
fieldIds: ['3iufciqo18ce5i4mntwrvt5me'],
createdAt: now,
},
],
color: '#ff9f74',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'n747l8btp9j8008l5u4zk8tlu',
name: 'pay_webhooks',
schema: 'public',
x: -261.64893419833186,
y: 260.75699721964776,
fields: [
{
id: '5ln8jh533mvpdh04g1g3oszq2',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default: "nextval('pay_webhooks_id_seq'::regclass)",
createdAt: now,
},
{
id: 'twn56a7rh02oyf2klyuougmox',
name: 'processor',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '23quf4a4598a6jci3n64a0462',
name: 'event_type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'z9flwsci25g0wxfolnytr23ea',
name: 'event',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '5nyrnndh5ezistd2dvfclrkw7',
name: 'created_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '8vgo1up2ftdq9os4exl4it8az',
name: 'updated_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
],
indexes: [
{
id: '1k24ziah265y69oa52f9v0w31',
name: 'pay_webhooks_pkey',
unique: true,
fieldIds: ['5ln8jh533mvpdh04g1g3oszq2'],
createdAt: now,
},
],
color: '#c05dcf',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'q05jbeaorkr669cjoy45gxjsq',
name: 'teams',
schema: 'public',
x: 388.05523632993504,
y: 441.84467099165886,
fields: [
{
id: 'yi4bszaf90nzux8kxxnkjgrbn',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default: "nextval('teams_id_seq'::regclass)",
createdAt: now,
},
{
id: 'vpjrs6irvjcn3t65qezor7pzv',
name: 'email',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'xu6zaouypt358jh9g08a129gn',
name: 'name',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'p4n7yyrgsyimi1meven4zuum7',
name: 'owner_type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '8lbzwgxgiafktwfncvw8swvep',
name: 'owner_id',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: 'qhj7xsbln7r9uxbxkdazj80pt',
name: 'index_teams_on_owner_type_and_owner_id',
unique: false,
fieldIds: [
'p4n7yyrgsyimi1meven4zuum7',
'8lbzwgxgiafktwfncvw8swvep',
],
createdAt: now,
},
{
id: 'cwsg3oytszcmyl586t4zpripe',
name: 'teams_pkey',
unique: true,
fieldIds: ['yi4bszaf90nzux8kxxnkjgrbn'],
createdAt: now,
},
],
color: '#c05dcf',
isView: false,
isMaterializedView: false,
createdAt: now,
},
{
id: 'sytadc777iuwh3qv6y87dpjod',
name: 'pay_payment_methods',
schema: 'public',
x: -260,
y: -180,
fields: [
{
id: 'wp1odzu9fzygrtv76xk2mssc0',
name: 'id',
type: {
id: 'integer',
name: 'integer',
},
primaryKey: true,
unique: true,
nullable: false,
default:
"nextval('pay_payment_methods_id_seq'::regclass)",
createdAt: now,
},
{
id: 'kijd5u5gitonxq5s34slmwilz',
name: 'customer_id',
type: {
id: 'bigint',
name: 'bigint',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'wb32rpwgup3fgyatmukpkmx69',
name: 'processor_id',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 't374z90f10wvoi2pz4p6bx6dh',
name: 'default',
type: {
id: 'boolean',
name: 'boolean',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'rr9n89apr62db8oa0490qvxzq',
name: 'payment_method_type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: '4b13bqjkhlyto6oqaftwmmnz1',
name: 'data',
type: {
id: 'json',
name: 'json',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'baqeq7dlxzmi7s63gpvtwpepw',
name: 'stripe_account',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
{
id: 'kjhau4523eujrp02tf1eufo3x',
name: 'created_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: 'hk9w613rvmy0kamhc9pb7p0mt',
name: 'updated_at',
type: {
id: 'timestamp_without_time_zone',
name: 'timestamp without time zone',
},
primaryKey: false,
unique: false,
nullable: false,
createdAt: now,
},
{
id: '5hk5apqscixnz0qtmbm5er0yb',
name: 'type',
type: {
id: 'character_varying',
name: 'character varying',
},
primaryKey: false,
unique: false,
nullable: true,
createdAt: now,
},
],
indexes: [
{
id: 'kq4zgarna1ij5x18139wtelj0',
name: 'pay_payment_methods_customer_id_processor_id_key',
unique: true,
fieldIds: [
'kijd5u5gitonxq5s34slmwilz',
'wb32rpwgup3fgyatmukpkmx69',
],
createdAt: now,
},
{
id: '7uumpmlal3pw47e9t76crjnvw',
name: 'index_pay_payment_methods_on_customer_id_and_processor_id',
unique: false,
fieldIds: [
'kijd5u5gitonxq5s34slmwilz',
'wb32rpwgup3fgyatmukpkmx69',
],
createdAt: now,
},
{
id: 'vswug2o9e1ndd7ncuw8p3x0lt',
name: 'pay_payment_methods_pkey',
unique: true,
fieldIds: ['wp1odzu9fzygrtv76xk2mssc0'],
createdAt: now,
},
],
color: '#ff9f74',
isView: false,
isMaterializedView: false,
createdAt: now,
},
],
relationships: [
{
id: 'efjc7b76t28lmz5ve53x5fymp',
name: 'fk_pay_payment_methods_customer_id',
sourceSchema: 'public',
targetSchema: 'public',
sourceTableId: 'sytadc777iuwh3qv6y87dpjod',
targetTableId: 'mpqg2uz3opvhby9wjy8oxi3td',
sourceFieldId: 'kijd5u5gitonxq5s34slmwilz',
targetFieldId: '3iufciqo18ce5i4mntwrvt5me',
sourceCardinality: 'many',
targetCardinality: 'one',
createdAt: now,
},
{
id: 'o4h2eo4k1bczmn6ouuanw5ps1',
name: 'fk_pay_charges_customer_id',
sourceSchema: 'public',
targetSchema: 'public',
sourceTableId: 'aliqiks5f2gm4du9io27jf1vy',
targetTableId: 'mpqg2uz3opvhby9wjy8oxi3td',
sourceFieldId: 'pv5smlh4qam1xwyxoq49ncuy8',
targetFieldId: '3iufciqo18ce5i4mntwrvt5me',
sourceCardinality: 'many',
targetCardinality: 'one',
createdAt: now,
},
{
id: 'pam0jo57dlzhck2o8m6e9kjg5',
name: 'fk_pay_subscriptions_customer_id',
sourceSchema: 'public',
targetSchema: 'public',
sourceTableId: 'eqjebesocq7ajoo07rk40drl9',
targetTableId: 'mpqg2uz3opvhby9wjy8oxi3td',
sourceFieldId: '1jb9hyb9oqqtxaxkci7f7j2gn',
targetFieldId: '3iufciqo18ce5i4mntwrvt5me',
sourceCardinality: 'many',
targetCardinality: 'one',
createdAt: now,
},
{
id: 'tncdm0i076z029fkjpqpg7af5',
name: 'fk_pay_charges_subscription_id',
sourceSchema: 'public',
targetSchema: 'public',
sourceTableId: 'aliqiks5f2gm4du9io27jf1vy',
targetTableId: 'eqjebesocq7ajoo07rk40drl9',
sourceFieldId: 'akm13624gviyp0hv9c2avabm5',
targetFieldId: 'olqm3l2frfckpj8twtjj51bs1',
sourceCardinality: 'many',
targetCardinality: 'one',
createdAt: now,
},
],
dependencies: [],
},
};