Compare commits
No commits in common. "master" and "v7.0.15" have entirely different histories.
52
CHANGES.md
52
CHANGES.md
|
@ -1,55 +1,3 @@
|
|||
2025-03-18, Version 7.1.1
|
||||
=========================
|
||||
|
||||
* chore: update dependency loopback-datasource-juggler to ^5.1.6 (renovate[bot])
|
||||
|
||||
* chore: update dependency loopback-connector to ^6.2.2 (renovate[bot])
|
||||
|
||||
* chore: update dependency @commitlint/config-conventional to ^19.8.0 (renovate[bot])
|
||||
|
||||
|
||||
2025-02-12, Version 7.1.0
|
||||
=========================
|
||||
|
||||
* chore: update dependency loopback-datasource-juggler to ^5.1.5 (renovate[bot])
|
||||
|
||||
* chore: update dependency loopback-connector to ^6.2.1 (renovate[bot])
|
||||
|
||||
* chore: update dependency @commitlint/config-conventional to ^19.7.1 (renovate[bot])
|
||||
|
||||
* chore: update dependency loopback-connector to ^6.2.0 (renovate[bot])
|
||||
|
||||
* feat: query to fetch unique columns (Muhammad Aaqil)
|
||||
|
||||
* chore: update dependency mocha to ^11.1.0 (renovate[bot])
|
||||
|
||||
* chore: update dependency debug to ^4.4.0 (renovate[bot])
|
||||
|
||||
|
||||
2024-12-05, Version 7.0.17
|
||||
==========================
|
||||
|
||||
* chore: update dependency loopback-datasource-juggler to ^5.1.3 (renovate[bot])
|
||||
|
||||
* chore: update dependency loopback-connector to ^6.1.12 (renovate[bot])
|
||||
|
||||
* chore: update dependency mocha to v11 (renovate[bot])
|
||||
|
||||
* chore: update dependency @commitlint/config-conventional to ^19.6.0 (renovate[bot])
|
||||
|
||||
|
||||
2024-11-12, Version 7.0.16
|
||||
==========================
|
||||
|
||||
* chore: update dependency loopback-connector to ^6.1.11 (renovate[bot])
|
||||
|
||||
* chore: update dependency loopback-datasource-juggler to ^5.1.2 (renovate[bot])
|
||||
|
||||
* chore: update dependency mocha to ^10.8.2 (renovate[bot])
|
||||
|
||||
* chore: update dependency loopback-connector to ^6.1.10 (renovate[bot])
|
||||
|
||||
|
||||
2024-10-11, Version 7.0.15
|
||||
==========================
|
||||
|
||||
|
|
|
@ -301,29 +301,6 @@ function mixinDiscovery(MySQL, mysql) {
|
|||
return sql;
|
||||
};
|
||||
|
||||
/**
|
||||
* Discover unique keys for a given table
|
||||
* @param {String} table The table name
|
||||
* @param {Object} options The options for discovery
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Retrieves a list of column names that have unique key index
|
||||
* @param schema
|
||||
* @param table
|
||||
* @returns {string}
|
||||
*/
|
||||
MySQL.prototype.buildQueryUniqueKeys = function(schema, table) {
|
||||
const sql = 'SELECT Column_name AS "columnName",' +
|
||||
' table_schema AS "owner",' +
|
||||
' table_name AS "tableName"' +
|
||||
' FROM Information_schema.statistics' +
|
||||
' WHERE Table_schema = ' + mysql.escape(schema) +
|
||||
' AND Table_name = ' + mysql.escape(table) +
|
||||
' AND Non_unique = 0 AND Index_name <> \'PRIMARY\';';
|
||||
return sql;
|
||||
};
|
||||
|
||||
/**
|
||||
* Discover foreign keys that reference to the primary key of this table
|
||||
* @param {String} table The table name
|
||||
|
|
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "loopback-connector-mysql",
|
||||
"version": "7.1.1",
|
||||
"version": "7.0.15",
|
||||
"description": "MySQL connector for loopback-datasource-juggler",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
|
@ -22,22 +22,22 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"async": "^3.2.6",
|
||||
"debug": "^4.4.0",
|
||||
"debug": "^4.3.7",
|
||||
"lodash": "^4.17.21",
|
||||
"loopback-connector": "^6.2.2",
|
||||
"loopback-connector": "^6.1.9",
|
||||
"mysql2": "^3.6.3",
|
||||
"patch-package": "^8.0.0",
|
||||
"strong-globalize": "^6.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/config-conventional": "^19.8.0",
|
||||
"@commitlint/config-conventional": "^19.5.0",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-loopback": "^13.1.0",
|
||||
"loopback-datasource-juggler": "^5.1.6",
|
||||
"mocha": "^11.1.0",
|
||||
"loopback-datasource-juggler": "^5.1.1",
|
||||
"mocha": "^10.7.3",
|
||||
"rc": "^1.2.8",
|
||||
"should": "^13.2.3",
|
||||
"sinon": "^20.0.0"
|
||||
"sinon": "^19.0.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -283,21 +283,6 @@ describe('Discover LDL schema from a table', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Discover unique properties', function() {
|
||||
let schema;
|
||||
before(function(done) {
|
||||
db.discoverSchema('CUSTOMER', {owner: 'STRONGLOOP'}, function(err, schema_) {
|
||||
schema = schema_;
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
it('should validate unique key for customer', function() {
|
||||
assert.ok(/STRONGLOOP/i.test(schema.options.mysql.schema));
|
||||
assert.strictEqual(schema.options.mysql.table, 'CUSTOMER');
|
||||
assert.strictEqual(schema.properties.email.index.unique, true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Discover and handle enum', function() {
|
||||
let schema;
|
||||
before(function(done) {
|
||||
|
|
|
@ -39,8 +39,7 @@ CREATE TABLE `CUSTOMER` (
|
|||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
ALTER TABLE `CUSTOMER`
|
||||
ADD COLUMN `email` VARCHAR(100) UNIQUE;
|
||||
|
||||
--
|
||||
-- Dumping data for table `CUSTOMER`
|
||||
--
|
||||
|
|
Loading…
Reference in New Issue