Created
December 29, 2022 18:55
-
-
Save adevinwild/7a47848853679705163cb19faff365c5 to your computer and use it in GitHub Desktop.
UserMigration for Medusa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Migration } from "medusa-extender"; | |
import { MigrationInterface, QueryRunner } from "typeorm"; | |
@Migration() | |
export default class addStoreIdToUser1672134240438 | |
implements MigrationInterface | |
{ | |
name = "addStoreIdToUser1672134240438"; | |
public async up(queryRunner: QueryRunner): Promise<void> { | |
const query = `ALTER TABLE public."user" ADD COLUMN IF NOT EXISTS "store_id" text;`; | |
await queryRunner.query(query); | |
} | |
public async down(queryRunner: QueryRunner): Promise<void> { | |
const query = `ALTER TABLE public."user" DROP COLUMN "store_id";`; | |
await queryRunner.query(query); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment