This commit is contained in:
2026-04-22 21:55:40 +03:30
parent 1a3a450960
commit f9e1ad69dc
85 changed files with 15644 additions and 4057 deletions
@@ -0,0 +1,70 @@
/*
Warnings:
- You are about to drop the `user_devices` table. If the table is not empty, all the data it contains will be lost.
- A unique constraint covering the columns `[tracking_code]` on the table `charged_license_transactions` will be added. If there are existing duplicate values, this will fail.
- Added the required column `tracking_code` to the `charged_license_transactions` table without a default value. This is not possible if the table is not empty.
*/
-- DropTable
DROP TABLE `user_devices`;
-- CreateTable
CREATE TABLE `consumer_devices` (
`uuid` VARCHAR(255) NOT NULL,
`app_version` VARCHAR(20) NOT NULL,
`build_number` VARCHAR(20) NOT NULL,
`platform` VARCHAR(100) NOT NULL,
`brand` VARCHAR(100) NOT NULL,
`model` VARCHAR(100) NOT NULL,
`device` VARCHAR(100) NOT NULL,
`os_version` VARCHAR(20) NOT NULL,
`sdk_version` VARCHAR(20) NOT NULL,
`release_number` VARCHAR(20) NOT NULL,
`browser_name` VARCHAR(100) NULL,
`fcm_token` VARCHAR(100) NULL,
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updated_at` TIMESTAMP(0) NOT NULL,
`consumer_id` VARCHAR(191) NOT NULL,
UNIQUE INDEX `consumer_devices_uuid_key` (`uuid`),
PRIMARY KEY (`uuid`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `application_released_info` (
`id` VARCHAR(191) NOT NULL,
`version` VARCHAR(191) NOT NULL,
`build_number` VARCHAR(191) NOT NULL,
`is_stable` BOOLEAN NOT NULL DEFAULT TRUE,
`is_minimum_supported` BOOLEAN NOT NULL DEFAULT FALSE,
`type` ENUM('ANDROID', 'IOS') NOT NULL,
`notes` JSON NULL,
`release_date` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updated_at` TIMESTAMP(0) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `consumer_devices`
ADD CONSTRAINT `consumer_devices_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE `charged_license_transactions`
ADD COLUMN `tracking_code` VARCHAR(191) NULL;
UPDATE `charged_license_transactions`
SET
`tracking_code` = CONCAT(
'TRX-',
UPPER(
REPLACE (`id`, '-', '')
)
)
WHERE
`tracking_code` IS NULL
OR `tracking_code` = '';
ALTER TABLE `charged_license_transactions`
MODIFY `tracking_code` VARCHAR(191) NOT NULL;
CREATE UNIQUE INDEX `charged_license_transactions_tracking_code_key` ON `charged_license_transactions` (`tracking_code`);
@@ -0,0 +1,19 @@
/*
Warnings:
- You are about to drop the column `is_stable` on the `application_released_info` table. All the data in the column will be lost.
- You are about to drop the column `type` on the `application_released_info` table. All the data in the column will be lost.
- Added the required column `platform` to the `application_released_info` table without a default value. This is not possible if the table is not empty.
- Added the required column `release_type` to the `application_released_info` table without a default value. This is not possible if the table is not empty.
- Added the required column `publisher` to the `consumer_devices` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `application_released_info` DROP COLUMN `is_stable`,
DROP COLUMN `type`,
ADD COLUMN `platform` ENUM('ANDROID', 'IOS') NOT NULL,
ADD COLUMN `release_type` ENUM('STABLE', 'BETA', 'ALPHA') NOT NULL;
-- AlterTable
ALTER TABLE `consumer_devices` ADD COLUMN `publisher` ENUM('DIRECT', 'CAFE_BAZAR', 'MAYKET') NOT NULL,
ADD COLUMN `user_agent` VARCHAR(100) NULL;