summaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-07-19 00:24:07 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-07-19 00:24:07 +0900
commit3f71b1463719bee476d39b7ceca5a2eea4b5cb67 (patch)
tree70003fc0a220785526289fd5b46d8c708a59c21d /migration
parentfix(client): プラグインの動作を修正 (diff)
downloadsharkey-3f71b1463719bee476d39b7ceca5a2eea4b5cb67.tar.gz
sharkey-3f71b1463719bee476d39b7ceca5a2eea4b5cb67.tar.bz2
sharkey-3f71b1463719bee476d39b7ceca5a2eea4b5cb67.zip
feat: Blurhash integration
Resolve #6559
Diffstat (limited to 'migration')
-rw-r--r--migration/1595075960584-blurhash.ts14
-rw-r--r--migration/1595077605646-blurhash-for-avatar-banner.ts20
2 files changed, 34 insertions, 0 deletions
diff --git a/migration/1595075960584-blurhash.ts b/migration/1595075960584-blurhash.ts
new file mode 100644
index 0000000000..7c716ae172
--- /dev/null
+++ b/migration/1595075960584-blurhash.ts
@@ -0,0 +1,14 @@
+import {MigrationInterface, QueryRunner} from "typeorm";
+
+export class blurhash1595075960584 implements MigrationInterface {
+ name = 'blurhash1595075960584'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "drive_file" ADD "blurhash" character varying(128)`);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "blurhash"`);
+ }
+
+}
diff --git a/migration/1595077605646-blurhash-for-avatar-banner.ts b/migration/1595077605646-blurhash-for-avatar-banner.ts
new file mode 100644
index 0000000000..fcf161c350
--- /dev/null
+++ b/migration/1595077605646-blurhash-for-avatar-banner.ts
@@ -0,0 +1,20 @@
+import {MigrationInterface, QueryRunner} from "typeorm";
+
+export class blurhashForAvatarBanner1595077605646 implements MigrationInterface {
+ name = 'blurhashForAvatarBanner1595077605646'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarColor"`);
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerColor"`);
+ await queryRunner.query(`ALTER TABLE "user" ADD "avatarBlurhash" character varying(128)`);
+ await queryRunner.query(`ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`);
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`);
+ await queryRunner.query(`ALTER TABLE "user" ADD "bannerColor" character varying(32)`);
+ await queryRunner.query(`ALTER TABLE "user" ADD "avatarColor" character varying(32)`);
+ }
+
+}