mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
- Introduced a new SQL schema for managing licenses and users, including foreign key relationships. - Implemented API routes for license validation, activation, and OTP-based user authentication. - Updated the license creation process to associate licenses with users and handle server IPs. - Added support for the nanoid package to generate unique license keys. - Refactored existing code to improve modularity and maintainability, including the separation of license and stripe-related logic into dedicated API routes. - Enhanced error handling and logging for better debugging and user feedback.
196 lines
4.8 KiB
JSON
196 lines
4.8 KiB
JSON
{
|
|
"id": "553c7c08-f9c6-4090-8372-8d27a389eaa7",
|
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.licenses": {
|
|
"name": "licenses",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"product_id": {
|
|
"name": "product_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"license_key": {
|
|
"name": "license_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"server_ips": {
|
|
"name": "server_ips",
|
|
"type": "text[]",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"activated_at": {
|
|
"name": "activated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"last_verified_at": {
|
|
"name": "last_verified_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"stripeCustomerId": {
|
|
"name": "stripeCustomerId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"stripeSubscriptionId": {
|
|
"name": "stripeSubscriptionId",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "CURRENT_TIMESTAMP"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "CURRENT_TIMESTAMP"
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"licenses_user_id_user_id_fk": {
|
|
"name": "licenses_user_id_user_id_fk",
|
|
"tableFrom": "licenses",
|
|
"tableTo": "user",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"licenses_license_key_unique": {
|
|
"name": "licenses_license_key_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"license_key"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.user": {
|
|
"name": "user",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "CURRENT_TIMESTAMP"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "CURRENT_TIMESTAMP"
|
|
},
|
|
"otp_code": {
|
|
"name": "otp_code",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"otp_code_expires_at": {
|
|
"name": "otp_code_expires_at",
|
|
"type": "timestamp",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"temporal_id": {
|
|
"name": "temporal_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "gen_random_uuid()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"user_email_unique": {
|
|
"name": "user_email_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"email"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |