UNPKG

@devx-commerce/plugin-loyalty

Version:

A starter for Medusa plugins.

18 lines 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Migration20250811171334 = void 0; const migrations_1 = require("@mikro-orm/migrations"); class Migration20250811171334 extends migrations_1.Migration { async up() { this.addSql(`alter table if exists "loyalty_referral" alter column "referral_code" type text using ("referral_code"::text);`); this.addSql(`alter table if exists "loyalty_referral" alter column "referral_code" set default '7dg55h';`); this.addSql(`alter table if exists "loyalty_transaction" add column if not exists "running_balance" integer not null default 0;`); } async down() { this.addSql(`alter table if exists "loyalty_referral" alter column "referral_code" type text using ("referral_code"::text);`); this.addSql(`alter table if exists "loyalty_referral" alter column "referral_code" set default 'u1fzm1';`); this.addSql(`alter table if exists "loyalty_transaction" drop column if exists "running_balance";`); } } exports.Migration20250811171334 = Migration20250811171334; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNTA4MTExNzEzMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9sb3lhbHR5L21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNTA4MTExNzEzMzQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsc0RBQWtEO0FBRWxELE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUFDLGdIQUFnSCxDQUFDLENBQUM7UUFDOUgsSUFBSSxDQUFDLE1BQU0sQ0FBQyw2RkFBNkYsQ0FBQyxDQUFDO1FBRTNHLElBQUksQ0FBQyxNQUFNLENBQUMsb0hBQW9ILENBQUMsQ0FBQztJQUNwSSxDQUFDO0lBRVEsS0FBSyxDQUFDLElBQUk7UUFDakIsSUFBSSxDQUFDLE1BQU0sQ0FBQyxnSEFBZ0gsQ0FBQyxDQUFDO1FBQzlILElBQUksQ0FBQyxNQUFNLENBQUMsNkZBQTZGLENBQUMsQ0FBQztRQUUzRyxJQUFJLENBQUMsTUFBTSxDQUFDLHNGQUFzRixDQUFDLENBQUM7SUFDdEcsQ0FBQztDQUVGO0FBaEJELDBEQWdCQyJ9