dbtasker 3.0.9 → 3.1.1
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.
- package/README.md +13 -7
- package/altercolumn.js +1 -1
- package/index.js +1 -1
- package/package.json +4 -1
- package/validation.js +1 -1
package/README.md
CHANGED
|
@@ -30,12 +30,12 @@ Property | Description
|
|
|
30
30
|
| **user** | Database Username |
|
|
31
31
|
| **password** | Database Password |
|
|
32
32
|
| **port** | Connection Port (Default: `3306`) |
|
|
33
|
-
| **
|
|
34
|
-
| **
|
|
35
|
-
| **
|
|
36
|
-
| **
|
|
37
|
-
| **
|
|
38
|
-
| **
|
|
33
|
+
| **drop database** | `Boolean`: If true, allows dropping databases. |
|
|
34
|
+
| **drop table** | `Boolean`: If true, allows dropping tables. |
|
|
35
|
+
| **drop column** | `Boolean`: If true, allows dropping columns. |
|
|
36
|
+
| **do not touch** | `Array`: List of database names protected from deletion. |
|
|
37
|
+
| **force delete column** | `Boolean`: If true, allow dropping column even if referanced by any other column. |
|
|
38
|
+
| **force update column** | `Boolean`: It is set `default: false` If true, allow updating column even if referanced by any other column. This one is very powerful. If you turn it on it will remove any foreign key that is referanced to the column is being updated then update the column then add the foreign key to those column again and if the column is set to `UNIQUE` it will remove all the column value that are simillar. |
|
|
39
39
|
|
|
40
40
|
### Configuration Example
|
|
41
41
|
`JavaScript`
|
|
@@ -118,6 +118,12 @@ ColumnTwo: {
|
|
|
118
118
|
|
|
119
119
|
| Feature | Supported Aliases |
|
|
120
120
|
| :--- | :--- |
|
|
121
|
+
| **Do not touch** | `donttouch, donottouch, donttouchdb, donottouchdb, donttouchdatabase, donottouchdatabase, dontdelete, donotdelete, dontdeletedb, donotdeletedb, dontdeletedatabase, donotdeletedatabase, dont_touch, do_not_touch, dont_touch_db, do_not_touch_db, dont_touch_database, do_not_touch_database, dont_delete, do_not_delete, dont_delete_db, do_not_delete_db, dont_delete_database, do_not_delete_database, reserveddb, reserved_db` |
|
|
122
|
+
| **Drop Database** | `dropdb, dropdatabase, deletedb, deletedatabase, drop_db, drop_database, delete_db, delete_database, removedb, removedatabase, remove_db, remove_database` |
|
|
123
|
+
| **Drop Table** | `droptable, deletetable, drop_table, delete_table, removetable, remove_table, dropdbtable, deletedbtable, removedbtable, dropdatabasetable, deletedatabasetable, removedatabasetable, drop_db_table, delete_db_table, remove_db_table, drop_database_table, delete_database_table, remove_database_table` |
|
|
124
|
+
| **Drop Column** | `dropcol, dropcolumn, deletecol, deletecolumn, removecol, removecolumn, drop_col, drop_column, delete_col, delete_column, remove_col, remove_column` |
|
|
125
|
+
| **Force Drop Column** | `forcedropcol, forcedropcolumn, forcedeletecol, forcedeletecolumn, forceremovecol, forceremovecolumn, force_drop_col, force_drop_column, force_delete_col, force_delete_column, force_remove_col, force_remove_column` |
|
|
126
|
+
| **Force Update Column** | `forceupdatecol, forcemodifycol, forceupdatecolumn, forcemodifycolumn, force_update_col, force_modify_col, force_update_column, force_modify_column, forcealtercol, forcealtercolumn, force_alter_col, force_alter_column` |
|
|
121
127
|
| **Type** | `type, columntype, column_type, datatype, data_type, typename, type_name` |
|
|
122
128
|
| **Length** | `length, size, scale, value, range, precision, maxlength, lengthvalue` |
|
|
123
129
|
| **Zerofill** | `zerofill, zero_fill, iszerofill, zerofillup, zero, fillzero, fill_zero, iszero` |
|
|
@@ -131,7 +137,7 @@ ColumnTwo: {
|
|
|
131
137
|
| `SpatialKey` | `spatial, spatialindex, isspatialkey, spatialkey, spatial_key, isspatial` |
|
|
132
138
|
| **Nullability** | `null, nulls, nullable, optional, isnulable, allownull, canbenull, notnull, not_null, nonnullable, notnullable, required, disallownull, non_nullable, not_nullable, disallow_null` |
|
|
133
139
|
| **Comments** | `comment, comments, columncomment, column_comment, description, label, helptext, hint, note` |
|
|
134
|
-
| **ForeignKey** | `fk, fuck, foreign_key, foreignkey` |
|
|
140
|
+
| **ForeignKey** | `fk, fuck, foreign, foreign_key, foreignkey` |
|
|
135
141
|
|
|
136
142
|
|
|
137
143
|
|
package/altercolumn.js
CHANGED
|
@@ -310,7 +310,7 @@ async function alterColumnQuery(dbConfig, columndata, columnName, tableName, dat
|
|
|
310
310
|
}
|
|
311
311
|
if (hasdupes === true) {
|
|
312
312
|
if (forceupdatecolumn) {
|
|
313
|
-
console.log(cstyler.bold.yellow("Cleaning duplicate rows before adding UNIQUE index
|
|
313
|
+
console.log(cstyler.bold.underline.yellow("***Cleaning duplicate rows before adding UNIQUE index***"));
|
|
314
314
|
const cleancol = await fncs.cleanDuplicateRows(dbConfig, database, tableName, columnName);
|
|
315
315
|
if (cleancol === null) {
|
|
316
316
|
console.error("Having server connection problem cleaning duplicate rows from database");
|
package/index.js
CHANGED
|
@@ -138,7 +138,7 @@ module.exports = async function (allconfig, table_json) {
|
|
|
138
138
|
} else if (falsers.includes(forceupdatecolumn)) {
|
|
139
139
|
forceupdatecolumn = false;
|
|
140
140
|
} else {
|
|
141
|
-
forceupdatecolumn =
|
|
141
|
+
forceupdatecolumn = false;
|
|
142
142
|
}
|
|
143
143
|
console.log(cstyler.bold.underline.yellow("Lets check if the table need an upgrade"))
|
|
144
144
|
// lets check all table name and column name
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dbtasker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"funding": {
|
|
5
5
|
"type": "patreon",
|
|
6
6
|
"url": "https://www.patreon.com/kormoi/gift"
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"automation",
|
|
24
24
|
"schema",
|
|
25
25
|
"dbtask",
|
|
26
|
+
"dbt",
|
|
27
|
+
"dbta",
|
|
28
|
+
"dbtool",
|
|
26
29
|
"database-automation",
|
|
27
30
|
"schema-sync",
|
|
28
31
|
"schema-builder",
|
package/validation.js
CHANGED
|
@@ -910,7 +910,7 @@ async function JSONchecker(table_json, config, separator = "_") {
|
|
|
910
910
|
let fktable = undefined;
|
|
911
911
|
let fkcolumn = undefined;
|
|
912
912
|
let foreign_key = {};
|
|
913
|
-
const fk_variations = ["fk", "fuck", "foreign_key", "foreignkey"];
|
|
913
|
+
const fk_variations = ["fk", "fuck", "foreign", "foreign_key", "foreignkey"];
|
|
914
914
|
for (const item of Object.keys(deepColumn)) {
|
|
915
915
|
if (fk_variations.includes(item.toLowerCase())) {
|
|
916
916
|
foreign_key = deepColumn[item];
|