jackson/npm/src/db/planetscale/entity/JacksonStore.ts

52 lines
780 B
TypeScript
Raw Normal View History

Feature/typeorm migrations (#141) * updated typeorm * renamed connection * updated migration scripts to new TypeORM version (v3) * typeorm and mongo -migrations and namespace column * update the mongo migration file * remove the camelcase * remove camelcase * rename the file * renaming migration files * folder restructuring and add migrate-mongo package * correcting path and minor changes * merging db name with URL * changing ts to js for mongo * migration automation with env variable * using custom scripts for migration * Dockerfile fixes * bootstrap script fixes and still need ts-node migrate-mongo in dockerfile * running migration in CI/CD * turning down planetscale * migration related fixes for namespace * Migration & bootstrap changes * reverting minor change * bootstrap.sh will only run in docker env * bootstrap RUN_MIGRATION env variable will use true * migration fixes * migration changes * removed console logs * planetscale migration fixes * copied back old files, tweaks to filenames * add index for namespace * restore older migration scripts * formatting * aligned timestamps * updated mysql, mariadb, mssql, planetscale namespace migrations * We'll run migrate manually as a separate step/container * forgot to add migrate.sh * bumped up timestamp * Enable planetscale testing * Revert planetscale test and comment config object * Revert deletions in Dockerfile * Update maria, mssql, mysql, ps, pg, sql namespace migrations * Cleanup * Add runMigration env to support manual run * Minor tweak * Ensure sql data migrations run after schema changes * Fix mssql namespace data migration query * Sync lock file * Update mongo timestamp * Set env for npm mongo migration script * [sql] Populate namespace column for synchronize: true instances * Rename `DB_RUN_MIGRATION` -> `DB_MANUAL_MIGRATION` * [mongo] Populate namespace for already deployed instances * Cleanup migrate.sh * [bash -> sh] bash does not work inside docker * Optimise migration artifacts * Source packages from global path * Copy npm from build context - excludes node_modules via .dockerignore * Remove redundant copy step * added swc packages * fresh package-lock * fresh package-lock * added migratepg job to skaffold fixes in migrate.sh to exit with error when migration fails * cleanup * added migratepg to demo skaffold as well * turn on planetscale tests --------- Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Utkarsh Mehta <ukrocks.mehta@gmail.com> Co-authored-by: Aswin V <vaswin91@gmail.com>
2023-10-13 22:29:21 +00:00
import { Entity, Column, Index } from 'typeorm';
@Entity({ name: 'jackson_store' })
export class JacksonStore {
@Column({
primary: true,
type: 'varchar',
length: 250,
})
key!: string;
@Column({
type: 'text',
})
value!: string;
@Column({
type: 'varchar',
length: 64,
nullable: true,
})
iv?: string;
@Column({
type: 'varchar',
length: 64,
nullable: true,
})
tag?: string;
@Column({
type: 'timestamp',
default: () => 'CURRENT_TIMESTAMP',
nullable: false,
})
createdAt?: Date;
@Column({
type: 'timestamp',
nullable: true,
})
modifiedAt?: string;
Feature/typeorm migrations (#141) * updated typeorm * renamed connection * updated migration scripts to new TypeORM version (v3) * typeorm and mongo -migrations and namespace column * update the mongo migration file * remove the camelcase * remove camelcase * rename the file * renaming migration files * folder restructuring and add migrate-mongo package * correcting path and minor changes * merging db name with URL * changing ts to js for mongo * migration automation with env variable * using custom scripts for migration * Dockerfile fixes * bootstrap script fixes and still need ts-node migrate-mongo in dockerfile * running migration in CI/CD * turning down planetscale * migration related fixes for namespace * Migration & bootstrap changes * reverting minor change * bootstrap.sh will only run in docker env * bootstrap RUN_MIGRATION env variable will use true * migration fixes * migration changes * removed console logs * planetscale migration fixes * copied back old files, tweaks to filenames * add index for namespace * restore older migration scripts * formatting * aligned timestamps * updated mysql, mariadb, mssql, planetscale namespace migrations * We'll run migrate manually as a separate step/container * forgot to add migrate.sh * bumped up timestamp * Enable planetscale testing * Revert planetscale test and comment config object * Revert deletions in Dockerfile * Update maria, mssql, mysql, ps, pg, sql namespace migrations * Cleanup * Add runMigration env to support manual run * Minor tweak * Ensure sql data migrations run after schema changes * Fix mssql namespace data migration query * Sync lock file * Update mongo timestamp * Set env for npm mongo migration script * [sql] Populate namespace column for synchronize: true instances * Rename `DB_RUN_MIGRATION` -> `DB_MANUAL_MIGRATION` * [mongo] Populate namespace for already deployed instances * Cleanup migrate.sh * [bash -> sh] bash does not work inside docker * Optimise migration artifacts * Source packages from global path * Copy npm from build context - excludes node_modules via .dockerignore * Remove redundant copy step * added swc packages * fresh package-lock * fresh package-lock * added migratepg job to skaffold fixes in migrate.sh to exit with error when migration fails * cleanup * added migratepg to demo skaffold as well * turn on planetscale tests --------- Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com> Co-authored-by: Utkarsh Mehta <ukrocks.mehta@gmail.com> Co-authored-by: Aswin V <vaswin91@gmail.com>
2023-10-13 22:29:21 +00:00
@Index('_jackson_store_namespace')
@Column({
type: 'varchar',
length: 64,
nullable: true,
})
namespace?: string;
}