nextjs-cms 0.9.13 → 0.9.14
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/update-sections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/update-sections.ts"],"names":[],"mappings":"AA4wCA,wBAAsB,cAAc,CAAC,SAAS,UAAQ,iBAoBrD"}
|
|
@@ -573,8 +573,8 @@ async function updateTable(table, s) {
|
|
|
573
573
|
else {
|
|
574
574
|
log.info(chalk.yellow(`- Field ${chalk.underline.italic(field)} not removed.`));
|
|
575
575
|
}
|
|
576
|
-
s.start();
|
|
577
576
|
}
|
|
577
|
+
s.start();
|
|
578
578
|
}
|
|
579
579
|
/**
|
|
580
580
|
* Execute ALTER TABLE statements
|
|
@@ -635,10 +635,15 @@ const main = async (s) => {
|
|
|
635
635
|
console.log(chalk.gray(sections.map((s) => s.name).join(', ')));
|
|
636
636
|
/**
|
|
637
637
|
* Let's see if the table `__nextjs_cms_tables` exists in the database.
|
|
638
|
-
* If it doesn't, we'll create it
|
|
639
|
-
* It has two fields: `name` and `created_at`.
|
|
638
|
+
* If it doesn't, we'll create it using the same schema as `NextJsCmsTablesTable`.
|
|
640
639
|
*/
|
|
641
|
-
await db.execute(sql `
|
|
640
|
+
await db.execute(sql `
|
|
641
|
+
CREATE TABLE IF NOT EXISTS __nextjs_cms_tables (
|
|
642
|
+
name VARCHAR(100) NOT NULL PRIMARY KEY,
|
|
643
|
+
section VARCHAR(200),
|
|
644
|
+
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
645
|
+
)
|
|
646
|
+
`);
|
|
642
647
|
/**
|
|
643
648
|
* Get the existing tables from the database
|
|
644
649
|
*/
|
|
@@ -955,7 +960,6 @@ const main = async (s) => {
|
|
|
955
960
|
],
|
|
956
961
|
initialValue: 'yes',
|
|
957
962
|
});
|
|
958
|
-
s.start();
|
|
959
963
|
if (overwriteExistingTable === 'yes') {
|
|
960
964
|
await ensureTableRegistryEntry(table.name, table.sectionName);
|
|
961
965
|
await updateTable(table, s);
|
|
@@ -994,7 +998,6 @@ const main = async (s) => {
|
|
|
994
998
|
return { value: table.name, label: table.name };
|
|
995
999
|
}),
|
|
996
1000
|
});
|
|
997
|
-
s.start();
|
|
998
1001
|
if (tableToRename && typeof tableToRename === 'string') {
|
|
999
1002
|
console.log(`Renaming table '${tableToRename}' to '${table.name}'`);
|
|
1000
1003
|
await renameTable(tableToRename, table.name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.14",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -210,8 +210,8 @@
|
|
|
210
210
|
"tsx": "^4.20.6",
|
|
211
211
|
"typescript": "^5.9.2",
|
|
212
212
|
"@lzcms/eslint-config": "0.3.0",
|
|
213
|
-
"@lzcms/
|
|
214
|
-
"@lzcms/
|
|
213
|
+
"@lzcms/tsconfig": "0.1.0",
|
|
214
|
+
"@lzcms/prettier-config": "0.1.0"
|
|
215
215
|
},
|
|
216
216
|
"license": "MIT",
|
|
217
217
|
"keywords": [
|