1634064348750-add_offline_settings.ts 889 B

12345678910111213141516
  1. import { MigrationInterface, QueryRunner } from 'typeorm'
  2. export class addOfflineSettings1634064348750 implements MigrationInterface {
  3. name = 'addOfflineSettings1634064348750'
  4. public async up(queryRunner: QueryRunner): Promise<void> {
  5. await queryRunner.query(
  6. 'CREATE TABLE `offline_settings` (`uuid` varchar(36) NOT NULL, `email` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `value` text NULL, `server_encryption_version` tinyint NOT NULL DEFAULT 0, `created_at` bigint NOT NULL, `updated_at` bigint NOT NULL, INDEX `index_offline_settings_on_name_and_email` (`name`, `email`), PRIMARY KEY (`uuid`)) ENGINE=InnoDB',
  7. )
  8. }
  9. public async down(queryRunner: QueryRunner): Promise<void> {
  10. await queryRunner.query('DROP INDEX `index_offline_settings_on_name_and_email` ON `offline_settings`')
  11. await queryRunner.query('DROP TABLE `offline_settings`')
  12. }
  13. }