Replaced the dedicated /admin/subscriptions page with a redirect to the central admin panel’s subscriptions tab. Removed session checks, imports, and the AdminSubscriptionDashboard since routing and access are now handled centrally. This streamlines admin UX and keeps access control unified.
29 lines
942 B
TypeScript
29 lines
942 B
TypeScript
/**
|
|
* Script para popular a tabela items unificada a partir do SQLite
|
|
*
|
|
* Este script:
|
|
* 1. Lê todos os itens de todas as tabelas do SQLite
|
|
* 2. Insere na tabela items do PostgreSQL com IDs únicos
|
|
* 3. Mapeia os dados para o formato unificado
|
|
*/
|
|
|
|
import { config } from "dotenv";
|
|
import { resolve } from "path";
|
|
import { importItemsFromSQLite } from "@/lib/items/import-from-sqlite";
|
|
import { secureLogger } from "@/lib/secure-logger";
|
|
|
|
async function populateItemsTable() {
|
|
config({ path: resolve(process.cwd(), ".env.local") });
|
|
config({ path: resolve(process.cwd(), ".env") });
|
|
|
|
secureLogger.info("Iniciando importação manual de itens (script standalone).");
|
|
const stats = await importItemsFromSQLite();
|
|
secureLogger.info("Importação manual finalizada.", stats);
|
|
}
|
|
|
|
populateItemsTable().catch((error) => {
|
|
secureLogger.error("Erro ao executar importação manual de itens", error);
|
|
process.exit(1);
|
|
});
|
|
|