masterrecord 0.3.53 → 0.3.55
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/Migrations/schema.js +3 -1
- package/context.js +4 -1
- package/package.json +1 -1
package/Migrations/schema.js
CHANGED
|
@@ -154,6 +154,7 @@ class schema{
|
|
|
154
154
|
await this._ensureReady();
|
|
155
155
|
if(table){
|
|
156
156
|
this.fullTable = table.___table;
|
|
157
|
+
this._tableObj = table;
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
|
|
@@ -490,7 +491,8 @@ class schema{
|
|
|
490
491
|
if(this.context.isSQLite){
|
|
491
492
|
var sqliteQuery = require("./migrationSQLiteQuery");
|
|
492
493
|
var queryBuilder = new sqliteQuery();
|
|
493
|
-
var
|
|
494
|
+
var tableSchema = (this._tableObj && this._tableObj[table.tableName]) || this.fullTable.new;
|
|
495
|
+
var queryObj = queryBuilder.alterColumn(tableSchema, table);
|
|
494
496
|
for (var key in queryObj) {
|
|
495
497
|
var query = queryObj[key];
|
|
496
498
|
await this.context._execute(query);
|
package/context.js
CHANGED
|
@@ -664,7 +664,10 @@ class context {
|
|
|
664
664
|
env(rootFolderLocationOrConfig) {
|
|
665
665
|
try {
|
|
666
666
|
// Determine environment: prefer explicit 'master' env var, then NODE_ENV
|
|
667
|
-
|
|
667
|
+
// Schema-only CLI commands (add-migration, enable-migrations) may run without
|
|
668
|
+
// an environment set — allow fallback to 'development' for those.
|
|
669
|
+
const envType = this.__environment || process.env.NODE_ENV
|
|
670
|
+
|| (process.env.MASTERRECORD_SCHEMA_ONLY === '1' ? 'development' : null);
|
|
668
671
|
if (!envType) {
|
|
669
672
|
throw new ConfigurationError(
|
|
670
673
|
"No environment specified. Set the 'master' or 'NODE_ENV' environment variable (e.g., master=production or NODE_ENV=development)."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "masterrecord",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.55",
|
|
4
4
|
"description": "An Object-relational mapping for the Master framework. Master Record connects classes to relational database tables to establish a database with almost zero-configuration ",
|
|
5
5
|
"main": "MasterRecord.js",
|
|
6
6
|
"bin": {
|