@qazuor/qzpay-drizzle 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1262,6 +1262,7 @@ var billingPromoCodes = pgCore.pgTable(
1262
1262
  maxUses: pgCore.integer("max_uses"),
1263
1263
  usedCount: pgCore.integer("used_count").default(0),
1264
1264
  maxPerCustomer: pgCore.integer("max_per_customer").default(1),
1265
+ maxUsesPerUser: pgCore.integer("max_uses_per_user").notNull().default(1),
1265
1266
  validPlans: pgCore.text("valid_plans").array(),
1266
1267
  newCustomersOnly: pgCore.boolean("new_customers_only").default(false),
1267
1268
  existingCustomersOnly: pgCore.boolean("existing_customers_only").default(false),
@@ -1291,7 +1292,8 @@ var billingPromoCodeUsage = pgCore.pgTable(
1291
1292
  },
1292
1293
  (table) => ({
1293
1294
  codeIdx: pgCore.index("idx_promo_usage_code").on(table.promoCodeId),
1294
- customerIdx: pgCore.index("idx_promo_usage_customer").on(table.customerId)
1295
+ customerIdx: pgCore.index("idx_promo_usage_customer").on(table.customerId),
1296
+ customerPromoUnique: pgCore.uniqueIndex("promo_code_usage_customer_promo_unique").on(table.customerId, table.promoCodeId)
1295
1297
  })
1296
1298
  );
1297
1299
  var billingPromoCodeInsertSchema = drizzleZod.createInsertSchema(billingPromoCodes);