.
This commit is contained in:
parent
885bc7f301
commit
000c247f00
@ -14,7 +14,7 @@ const createCatalogTableIfNotExists = async (sequelize: Sequelize) => {
|
|||||||
AND table_name = 'catalog';`;
|
AND table_name = 'catalog';`;
|
||||||
|
|
||||||
const [result]: any = await sequelize.query(checkTableQuery);
|
const [result]: any = await sequelize.query(checkTableQuery);
|
||||||
const tableExists = result[0]["COUNT(*)"] > 0;
|
const tableExists = result.length > 0 && result[0].count > 0;
|
||||||
|
|
||||||
if (!tableExists) {
|
if (!tableExists) {
|
||||||
// Consulta para crear la tabla si no existe
|
// Consulta para crear la tabla si no existe
|
||||||
@ -63,7 +63,7 @@ const createCatalogTranslationsTableIfNotExists = async (sequelize: Sequelize) =
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const [result]: any = await sequelize.query(checkTableQuery);
|
const [result]: any = await sequelize.query(checkTableQuery);
|
||||||
const tableExists = result[0]["COUNT(*)"] > 0;
|
const tableExists = result.length > 0 && result[0].count > 0;
|
||||||
|
|
||||||
if (!tableExists) {
|
if (!tableExists) {
|
||||||
// Consulta para crear la tabla si no existe
|
// Consulta para crear la tabla si no existe
|
||||||
@ -111,7 +111,7 @@ const createVCatalogViewIfNotExists = async (sequelize: Sequelize) => {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const [result]: any = await sequelize.query(checkViewQuery);
|
const [result]: any = await sequelize.query(checkViewQuery);
|
||||||
const viewExists = result[0]["COUNT(*)"] > 0;
|
const viewExists = result.length > 0 && result[0].count > 0;
|
||||||
|
|
||||||
if (!viewExists) {
|
if (!viewExists) {
|
||||||
// Consulta para crear la tabla si no existe
|
// Consulta para crear la tabla si no existe
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user