@na1647/offshore-adapter-tests 0.0.0-stage → 1.2.0
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/.eslintignore +1 -0
- package/.eslintrc +35 -0
- package/.travis.yml +32 -0
- package/CHANGELOG.md +24 -0
- package/Dockerfile +7 -0
- package/LICENSE.md +11 -0
- package/README.md +71 -2
- package/docker-compose.yml +32 -0
- package/features/autoIncrement/README.md +37 -0
- package/features/autoIncrement/core/autoIncrement.test.js +151 -0
- package/features/autoIncrement/sequential/autoIncrementSequential.test.js +104 -0
- package/features/autoIncrement/support/autoInc.fixture.js +25 -0
- package/features/compositePrimaryKey/core/compositePrimaryKey.test.js +67 -0
- package/features/compositePrimaryKey/support/fixture.js +24 -0
- package/features/compositeUnique/core/compositeUnique.test.js +67 -0
- package/features/compositeUnique/support/fixture.js +30 -0
- package/features/crossAdapter/core/crossAdapter.js +119 -0
- package/features/crossAdapter/support/bootstrap.js +106 -0
- package/features/sequences/core/sequences.test.js +110 -0
- package/features/sequences/support/mariadb.js +23 -0
- package/features/sequences/support/oracle.js +23 -0
- package/features/sequences/support/postgres.js +23 -0
- package/features/spatial/core/geojson.test.js +68 -0
- package/features/spatial/support/fixtures.js +82 -0
- package/features/spatial/support/models.js +45 -0
- package/features/unique/README.md +18 -0
- package/features/unique/core/unique.test.js +107 -0
- package/features/unique/support/unique.fixture.js +26 -0
- package/interfaces/associations/belongsTo/create.js +41 -0
- package/interfaces/associations/belongsTo/create.nested.customPK.js +61 -0
- package/interfaces/associations/belongsTo/create.nested.js +52 -0
- package/interfaces/associations/belongsTo/dynamicFinder.js +213 -0
- package/interfaces/associations/belongsTo/find.populate.js +145 -0
- package/interfaces/associations/belongsTo/findOne.populate.js +84 -0
- package/interfaces/associations/belongsTo/modifiers.js +275 -0
- package/interfaces/associations/belongsTo/multipleForeignKeys.js +70 -0
- package/interfaces/associations/belongsTo/update.nested.customPK.js +141 -0
- package/interfaces/associations/belongsTo/update.nested.js +174 -0
- package/interfaces/associations/deep.associations.test.js +437 -0
- package/interfaces/associations/find.associations.test.js +92 -0
- package/interfaces/associations/hasMany/add.js +106 -0
- package/interfaces/associations/hasMany/create.nested.customPK.js +113 -0
- package/interfaces/associations/hasMany/create.nested.js +96 -0
- package/interfaces/associations/hasMany/find.populate.customPK.js +75 -0
- package/interfaces/associations/hasMany/find.populate.js +219 -0
- package/interfaces/associations/hasMany/find.populate.where.js +148 -0
- package/interfaces/associations/hasMany/findOne.populate.js +88 -0
- package/interfaces/associations/hasMany/modifiers.js +560 -0
- package/interfaces/associations/hasMany/multipleForeignKeys.js +113 -0
- package/interfaces/associations/hasMany/remove.js +96 -0
- package/interfaces/associations/hasMany/update.nested.customPK.js +148 -0
- package/interfaces/associations/hasMany/update.nested.js +202 -0
- package/interfaces/associations/manyToMany/add.js +136 -0
- package/interfaces/associations/manyToMany/create.nested.customPK.js +109 -0
- package/interfaces/associations/manyToMany/create.nested.js +96 -0
- package/interfaces/associations/manyToMany/destroy.js +128 -0
- package/interfaces/associations/manyToMany/find.populate.js +109 -0
- package/interfaces/associations/manyToMany/find.populate.where.js +75 -0
- package/interfaces/associations/manyToMany/find.populate.withSchema.js +91 -0
- package/interfaces/associations/manyToMany/findOne.populate.js +86 -0
- package/interfaces/associations/manyToMany/modifiers.js +558 -0
- package/interfaces/associations/manyToMany/remove.js +103 -0
- package/interfaces/associations/manyToMany/update.js +105 -0
- package/interfaces/associations/manyToMany/update.nested.customPK.js +315 -0
- package/interfaces/associations/manyToMany/update.nested.js +355 -0
- package/interfaces/associations/manyToManyThrough/add.js +109 -0
- package/interfaces/associations/manyToManyThrough/create.nested.customPK.js +118 -0
- package/interfaces/associations/manyToManyThrough/create.nested.js +114 -0
- package/interfaces/associations/manyToManyThrough/find.populate.customPK.js +76 -0
- package/interfaces/associations/manyToManyThrough/find.populate.js +120 -0
- package/interfaces/associations/manyToManyThrough/find.populate.where.js +157 -0
- package/interfaces/associations/manyToManyThrough/findOne.populate.js +93 -0
- package/interfaces/associations/manyToManyThrough/modifiers.js +560 -0
- package/interfaces/associations/manyToManyThrough/multipleForeignKeys.js +118 -0
- package/interfaces/associations/manyToManyThrough/remove.js +98 -0
- package/interfaces/associations/manyToManyThrough/update.nested.customPK.js +150 -0
- package/interfaces/associations/manyToManyThrough/update.nested.js +202 -0
- package/interfaces/associations/oneToOne/create.js +41 -0
- package/interfaces/associations/oneToOne/create.nested.customPK.js +61 -0
- package/interfaces/associations/oneToOne/create.nested.js +52 -0
- package/interfaces/associations/oneToOne/dynamicFinder.js +68 -0
- package/interfaces/associations/oneToOne/find.populate.js +127 -0
- package/interfaces/associations/oneToOne/findOne.populate.js +83 -0
- package/interfaces/associations/oneToOne/modifiers.js +275 -0
- package/interfaces/associations/oneToOne/multipleForeignKeys.js +69 -0
- package/interfaces/associations/oneToOne/update.nested.customPK.js +141 -0
- package/interfaces/associations/oneToOne/update.nested.js +174 -0
- package/interfaces/associations/support/bootstrap.js +82 -0
- package/interfaces/associations/support/fixtures/belongsTo.child.customPK.fixture.js +25 -0
- package/interfaces/associations/support/fixtures/belongsTo.child.fixture.js +25 -0
- package/interfaces/associations/support/fixtures/belongsTo.parent.customPK.fixture.js +26 -0
- package/interfaces/associations/support/fixtures/belongsTo.parent.fixture.js +28 -0
- package/interfaces/associations/support/fixtures/crud.fixture.js +53 -0
- package/interfaces/associations/support/fixtures/deep.address.fixture.js +21 -0
- package/interfaces/associations/support/fixtures/deep.breakdown.fixture.js +23 -0
- package/interfaces/associations/support/fixtures/deep.company.fixture.js +29 -0
- package/interfaces/associations/support/fixtures/deep.country.fixture.js +25 -0
- package/interfaces/associations/support/fixtures/deep.departement.fixture.js +24 -0
- package/interfaces/associations/support/fixtures/deep.driver.fixture.js +32 -0
- package/interfaces/associations/support/fixtures/deep.ride.fixture.js +23 -0
- package/interfaces/associations/support/fixtures/deep.seller.fixture.js +33 -0
- package/interfaces/associations/support/fixtures/deep.taxi.fixture.js +36 -0
- package/interfaces/associations/support/fixtures/hasMany.child.fixture.js +33 -0
- package/interfaces/associations/support/fixtures/hasMany.customPK.fixture.js +22 -0
- package/interfaces/associations/support/fixtures/hasMany.parent.fixture.js +28 -0
- package/interfaces/associations/support/fixtures/hasManyThrough.child.customPK.fixture.js +32 -0
- package/interfaces/associations/support/fixtures/hasManyThrough.parent.customPK.fixture.js +23 -0
- package/interfaces/associations/support/fixtures/hasManyThrough.stadium.fixture.js +20 -0
- package/interfaces/associations/support/fixtures/hasManyThrough.team.fixture.js +35 -0
- package/interfaces/associations/support/fixtures/hasManyThrough.through.customPK.fixture.js +18 -0
- package/interfaces/associations/support/fixtures/hasManyThrough.venue.fixture.js +18 -0
- package/interfaces/associations/support/fixtures/manyToMany.driver.customPK.fixture.js +22 -0
- package/interfaces/associations/support/fixtures/manyToMany.driver.fixture.js +25 -0
- package/interfaces/associations/support/fixtures/manyToMany.driver.withSchema.fixture.js +25 -0
- package/interfaces/associations/support/fixtures/manyToMany.taxi.customPK.fixture.js +21 -0
- package/interfaces/associations/support/fixtures/manyToMany.taxi.fixture.js +30 -0
- package/interfaces/associations/support/fixtures/manyToMany.taxi.withSchema.fixture.js +24 -0
- package/interfaces/associations/support/fixtures/multipleAssociations.fixture.js +54 -0
- package/interfaces/associations/support/fixtures/multipleOneToOneAssociations.fixture.js +40 -0
- package/interfaces/associations/support/fixtures/multipleThroughAssociations.fixture.js +79 -0
- package/interfaces/associations/support/fixtures/oneToOne.customPK.fixture.js +47 -0
- package/interfaces/associations/support/fixtures/oneToOne.fixture.js +52 -0
- package/interfaces/associations/support/fixtures.js +41 -0
- package/interfaces/datastore/datastore.test.js +63 -0
- package/interfaces/migratable/definition.test.js +65 -0
- package/interfaces/migratable/migrate.alter.test.js +55 -0
- package/interfaces/migratable/migrate.create.test.js +120 -0
- package/interfaces/migratable/migrate.drop.test.js +47 -0
- package/interfaces/migratable/migrate.safe.test.js +25 -0
- package/interfaces/migratable/schema.test.js +117 -0
- package/interfaces/migratable/support/bootstrap.js +55 -0
- package/interfaces/migratable/support/bootstrapFn.js +54 -0
- package/interfaces/migratable/support/fixtures/alter.fixture.js +12 -0
- package/interfaces/migratable/support/fixtures/create.fixture.js +12 -0
- package/interfaces/migratable/support/fixtures/crud.fixture.js +53 -0
- package/interfaces/migratable/support/fixtures/custom.fixture.js +17 -0
- package/interfaces/migratable/support/fixtures/drop.fixture.js +12 -0
- package/interfaces/migratable/support/fixtures/safe.fixture.js +12 -0
- package/interfaces/migratable/support/fixtures/schema.fixture.js +23 -0
- package/interfaces/queryable/caseInsensitive.test.js +196 -0
- package/interfaces/queryable/count.test.js +51 -0
- package/interfaces/queryable/dynamicFinders.test.js +179 -0
- package/interfaces/queryable/findLike.test.js +34 -0
- package/interfaces/queryable/findOneLike.test.js +28 -0
- package/interfaces/queryable/modifiers/average.modifier.test.js +55 -0
- package/interfaces/queryable/modifiers/contains.modifier.test.js +82 -0
- package/interfaces/queryable/modifiers/endsWith.modifier.test.js +82 -0
- package/interfaces/queryable/modifiers/greaterThan.modifier.test.js +335 -0
- package/interfaces/queryable/modifiers/groupBy.modifier.test.js +123 -0
- package/interfaces/queryable/modifiers/in.modifier.test.js +76 -0
- package/interfaces/queryable/modifiers/lessThan.modifier.test.js +223 -0
- package/interfaces/queryable/modifiers/like.modifier.test.js +50 -0
- package/interfaces/queryable/modifiers/limit.modifier.test.js +60 -0
- package/interfaces/queryable/modifiers/max.modifier.test.js +68 -0
- package/interfaces/queryable/modifiers/min.modifier.test.js +68 -0
- package/interfaces/queryable/modifiers/not.modifier.test.js +80 -0
- package/interfaces/queryable/modifiers/notIn.modifier.test.js +69 -0
- package/interfaces/queryable/modifiers/or.modifier.test.js +142 -0
- package/interfaces/queryable/modifiers/select.modifier.test.js +118 -0
- package/interfaces/queryable/modifiers/skip.modifier.test.js +59 -0
- package/interfaces/queryable/modifiers/sort.modifier.test.js +160 -0
- package/interfaces/queryable/modifiers/startsWith.modifier.test.js +83 -0
- package/interfaces/queryable/modifiers/sum.modifier.test.js +68 -0
- package/interfaces/queryable/support/bootstrap.js +80 -0
- package/interfaces/queryable/support/fixtures/crud.fixture.js +54 -0
- package/interfaces/scalable/README.md +19 -0
- package/interfaces/scalable/crud.test.js +73 -0
- package/interfaces/scalable/queries.test.js +9 -0
- package/interfaces/scalable/support/crud.fixture.js +60 -0
- package/interfaces/semantic/create.test.js +110 -0
- package/interfaces/semantic/createEach.test.js +50 -0
- package/interfaces/semantic/destroy.js +147 -0
- package/interfaces/semantic/find.test.js +91 -0
- package/interfaces/semantic/findOne.test.js +60 -0
- package/interfaces/semantic/findOrCreate.test.js +91 -0
- package/interfaces/semantic/findOrCreateEach.test.js +75 -0
- package/interfaces/semantic/support/bootstrap.js +85 -0
- package/interfaces/semantic/support/fixtures/crud.fixture.js +66 -0
- package/interfaces/semantic/support/fixtures/validations.fixture.js +23 -0
- package/interfaces/semantic/types/array.type.js +28 -0
- package/interfaces/semantic/types/binary.type.js +34 -0
- package/interfaces/semantic/types/boolean.type.js +80 -0
- package/interfaces/semantic/types/date.type.js +53 -0
- package/interfaces/semantic/types/datetime.type.js +48 -0
- package/interfaces/semantic/types/float.type.js +40 -0
- package/interfaces/semantic/types/integer.type.js +40 -0
- package/interfaces/semantic/types/json.type.js +29 -0
- package/interfaces/semantic/types/string.type.js +40 -0
- package/interfaces/semantic/types/text.type.js +34 -0
- package/interfaces/semantic/types/time.type.js +52 -0
- package/interfaces/semantic/update.test.js +157 -0
- package/interfaces/sql/find.test.js +73 -0
- package/interfaces/sql/query.test.js +40 -0
- package/interfaces/sql/support/bootstrap.js +82 -0
- package/interfaces/sql/support/fixtures/crud.fixture.js +57 -0
- package/interfaces/transactable/commit.test.js +438 -0
- package/interfaces/transactable/crossAdapter.test.js +346 -0
- package/interfaces/transactable/deep.test.js +100 -0
- package/interfaces/transactable/rollback.test.js +221 -0
- package/interfaces/transactable/support/bootstrap.js +55 -0
- package/interfaces/transactable/support/bootstrapFn.js +51 -0
- package/interfaces/transactable/support/fixtures/customer.fixture.js +29 -0
- package/interfaces/transactable/support/fixtures/payment.fixture.js +24 -0
- package/interfaces/transactable/support/fixtures/receipt.fixture.js +20 -0
- package/interfaces/transactable/support/fixtures/store.fixture.js +22 -0
- package/interfaces/transactable/support/fixtures/storecustomer.fixture.js +14 -0
- package/lib/index.js +155 -0
- package/lib/utils.js +39 -0
- package/package.json +58 -4
- package/test/integration/README.md +26 -0
- package/test/integration/config/offshore-memory.js +8 -0
- package/test/integration/config/offshore-sql-mariadb.js +15 -0
- package/test/integration/config/offshore-sql-mysql.js +21 -0
- package/test/integration/config/offshore-sql-oracle.js +19 -0
- package/test/integration/config/offshore-sql-postgres.js +27 -0
- package/test/integration/config/offshore-sql-sqlite3.js +19 -0
- package/test/integration/runner.js +83 -0
- package/test/integration/runnerDispatcher.js +163 -0
- package/test/load/README.md +20 -0
- package/test/load/index.js +33 -0
- package/test/load/runner.js +160 -0
- package/test/load/support/bootstrap.js +69 -0
- package/test/load/support/fixtures/pet.js +8 -0
- package/test/load/support/fixtures/user.js +9 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
identity: 'DriverDeep',
|
|
4
|
+
tableName: 'driverDeepTable',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
id: {
|
|
8
|
+
type: 'integer',
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
autoIncrement: true
|
|
11
|
+
},
|
|
12
|
+
name: {
|
|
13
|
+
type: 'string'
|
|
14
|
+
},
|
|
15
|
+
taxis: {
|
|
16
|
+
collection: 'TaxiDeep',
|
|
17
|
+
via: 'driver',
|
|
18
|
+
through: 'rideDeep'
|
|
19
|
+
},
|
|
20
|
+
address: {
|
|
21
|
+
model: 'AddressDeep'
|
|
22
|
+
},
|
|
23
|
+
company: {
|
|
24
|
+
model: 'CompanyDeep'
|
|
25
|
+
},
|
|
26
|
+
toJSON: function() {
|
|
27
|
+
var obj = this.toObject();
|
|
28
|
+
delete obj.name;
|
|
29
|
+
return obj;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
identity: 'RideDeep',
|
|
4
|
+
tableName: 'rideDeepTable',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
id: {
|
|
8
|
+
type: 'integer',
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
autoIncrement: true
|
|
11
|
+
},
|
|
12
|
+
taxi: {
|
|
13
|
+
model: 'TaxiDeep'
|
|
14
|
+
},
|
|
15
|
+
driver: {
|
|
16
|
+
model: 'DriverDeep'
|
|
17
|
+
},
|
|
18
|
+
toJSON: function() {
|
|
19
|
+
var obj = this.toObject();
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
identity: 'SellerDeep',
|
|
4
|
+
tableName: 'sellerDeepTable',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
id: {
|
|
8
|
+
type: 'integer',
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
autoIncrement: true
|
|
11
|
+
},
|
|
12
|
+
name: {
|
|
13
|
+
type: 'string'
|
|
14
|
+
},
|
|
15
|
+
taxis: {
|
|
16
|
+
collection: 'TaxiDeep',
|
|
17
|
+
via: 'seller'
|
|
18
|
+
},
|
|
19
|
+
departments: {
|
|
20
|
+
collection: 'DepartmentDeep',
|
|
21
|
+
via: 'seller'
|
|
22
|
+
},
|
|
23
|
+
countries: {
|
|
24
|
+
collection: 'CountryDeep',
|
|
25
|
+
via: 'sellers'
|
|
26
|
+
},
|
|
27
|
+
toJSON: function() {
|
|
28
|
+
var obj = this.toObject();
|
|
29
|
+
delete obj.name;
|
|
30
|
+
return obj;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'taxiDeepTable',
|
|
4
|
+
identity: 'taxiDeep',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
id: {
|
|
8
|
+
type: 'integer',
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
autoIncrement: true
|
|
11
|
+
},
|
|
12
|
+
matricule: {
|
|
13
|
+
type: 'string'
|
|
14
|
+
},
|
|
15
|
+
drivers: {
|
|
16
|
+
collection: 'DriverDeep',
|
|
17
|
+
via: 'taxi',
|
|
18
|
+
through: 'rideDeep'
|
|
19
|
+
},
|
|
20
|
+
company: {
|
|
21
|
+
model: 'CompanyDeep'
|
|
22
|
+
},
|
|
23
|
+
seller: {
|
|
24
|
+
model: 'SellerDeep'
|
|
25
|
+
},
|
|
26
|
+
breakdowns: {
|
|
27
|
+
collection: 'BreakDownDeep',
|
|
28
|
+
via: 'taxi'
|
|
29
|
+
},
|
|
30
|
+
toJSON: function() {
|
|
31
|
+
var obj = this.toObject();
|
|
32
|
+
delete obj.matricule;
|
|
33
|
+
return obj;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'paymentTable',
|
|
4
|
+
identity: 'payment',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
amount: {
|
|
8
|
+
type: 'integer'
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
bank: {
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
currency: {
|
|
17
|
+
type: 'string'
|
|
18
|
+
},
|
|
19
|
+
apartment: {
|
|
20
|
+
model: 'apartment'
|
|
21
|
+
},
|
|
22
|
+
a_customer: {
|
|
23
|
+
model: 'Customer'
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
toJSON: function() {
|
|
27
|
+
var obj = this.toObject();
|
|
28
|
+
delete obj.type;
|
|
29
|
+
return obj;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'apartmentTable',
|
|
4
|
+
identity: 'apartment',
|
|
5
|
+
autoPK: false,
|
|
6
|
+
|
|
7
|
+
attributes: {
|
|
8
|
+
building: {
|
|
9
|
+
type: 'string'
|
|
10
|
+
},
|
|
11
|
+
number: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
primaryKey: true,
|
|
14
|
+
unique: true
|
|
15
|
+
},
|
|
16
|
+
payments: {
|
|
17
|
+
collection: 'Payment',
|
|
18
|
+
via: 'apartment'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'customerTable',
|
|
4
|
+
identity: 'customer',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
name: {
|
|
8
|
+
type: 'string'
|
|
9
|
+
},
|
|
10
|
+
title: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
capital : {
|
|
14
|
+
type: 'integer'
|
|
15
|
+
},
|
|
16
|
+
payments: {
|
|
17
|
+
collection: 'Payment',
|
|
18
|
+
via: 'a_customer'
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
toJSON: function() {
|
|
22
|
+
var obj = this.toObject();
|
|
23
|
+
delete obj.name;
|
|
24
|
+
return obj;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'teamCustomTable',
|
|
4
|
+
identity: 'teamCustom',
|
|
5
|
+
|
|
6
|
+
autoPk: false,
|
|
7
|
+
|
|
8
|
+
attributes: {
|
|
9
|
+
location: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
primaryKey: true
|
|
12
|
+
},
|
|
13
|
+
name: {
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
mascot: {
|
|
17
|
+
type: 'string'
|
|
18
|
+
},
|
|
19
|
+
stadiums: {
|
|
20
|
+
collection: 'stadiumcustom',
|
|
21
|
+
through: 'venuecustom',
|
|
22
|
+
via: 'team'
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
toJSON: function() {
|
|
26
|
+
var obj = this.toObject();
|
|
27
|
+
delete obj.mascot;
|
|
28
|
+
return obj;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'stadiumCustomTable',
|
|
4
|
+
identity: 'stadiumCustom',
|
|
5
|
+
|
|
6
|
+
autoPK: false,
|
|
7
|
+
|
|
8
|
+
attributes: {
|
|
9
|
+
address: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
primaryKey: true
|
|
12
|
+
},
|
|
13
|
+
name: {
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
teams: {
|
|
17
|
+
collection: 'teamcustom',
|
|
18
|
+
through: 'venuecustom',
|
|
19
|
+
via: 'stadium'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'stadiumTable',
|
|
4
|
+
identity: 'stadium',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
name: {
|
|
8
|
+
type: 'string'
|
|
9
|
+
},
|
|
10
|
+
budget: {
|
|
11
|
+
type: 'integer'
|
|
12
|
+
},
|
|
13
|
+
teams: {
|
|
14
|
+
collection: 'Team',
|
|
15
|
+
through: 'venue',
|
|
16
|
+
via: 'stadium'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'teamTable',
|
|
4
|
+
identity: 'team',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
name: {
|
|
8
|
+
type: 'string'
|
|
9
|
+
},
|
|
10
|
+
mascot: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
followers: {
|
|
14
|
+
type: 'integer'
|
|
15
|
+
},
|
|
16
|
+
score: {
|
|
17
|
+
type: 'integer'
|
|
18
|
+
},
|
|
19
|
+
league: {
|
|
20
|
+
type: 'integer'
|
|
21
|
+
},
|
|
22
|
+
stadiums: {
|
|
23
|
+
collection: 'Stadium',
|
|
24
|
+
through: 'venue',
|
|
25
|
+
via: 'team'
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
toJSON: function() {
|
|
29
|
+
var obj = this.toObject();
|
|
30
|
+
delete obj.mascot;
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'driverTableCustomPK',
|
|
4
|
+
identity: 'drivercustom',
|
|
5
|
+
|
|
6
|
+
autoPK: false,
|
|
7
|
+
|
|
8
|
+
attributes: {
|
|
9
|
+
number: {
|
|
10
|
+
type: 'integer',
|
|
11
|
+
primaryKey: true
|
|
12
|
+
},
|
|
13
|
+
name: {
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
taxis: {
|
|
17
|
+
collection: 'taxicustom',
|
|
18
|
+
via: 'drivers',
|
|
19
|
+
dominant: true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'driverTable',
|
|
4
|
+
identity: 'driver',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
name: {
|
|
8
|
+
type: 'string'
|
|
9
|
+
},
|
|
10
|
+
drivingTime: {
|
|
11
|
+
type: 'integer'
|
|
12
|
+
},
|
|
13
|
+
taxis: {
|
|
14
|
+
collection: 'taxi',
|
|
15
|
+
via: 'drivers',
|
|
16
|
+
dominant: true
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
toJSON: function() {
|
|
20
|
+
var obj = this.toObject();
|
|
21
|
+
delete obj.name;
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'driverWithSchemaTable',
|
|
4
|
+
meta: {
|
|
5
|
+
schemaName: 'foo'
|
|
6
|
+
},
|
|
7
|
+
identity: 'driverwithschema',
|
|
8
|
+
|
|
9
|
+
attributes: {
|
|
10
|
+
name: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
taxis: {
|
|
14
|
+
collection: 'taxiwithschema',
|
|
15
|
+
via: 'drivers',
|
|
16
|
+
dominant: true
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
toJSON: function() {
|
|
20
|
+
var obj = this.toObject();
|
|
21
|
+
delete obj.name;
|
|
22
|
+
return obj;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'taxiTableCustomPK',
|
|
4
|
+
identity: 'taxicustom',
|
|
5
|
+
|
|
6
|
+
autoPK: false,
|
|
7
|
+
|
|
8
|
+
attributes: {
|
|
9
|
+
vin: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
primaryKey: true
|
|
12
|
+
},
|
|
13
|
+
medallion: {
|
|
14
|
+
type: 'integer'
|
|
15
|
+
},
|
|
16
|
+
drivers: {
|
|
17
|
+
collection: 'drivercustom',
|
|
18
|
+
via: 'taxis'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'taxiTable',
|
|
4
|
+
identity: 'taxi',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
medallion: {
|
|
8
|
+
type: 'integer'
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
brand: {
|
|
14
|
+
type: 'string'
|
|
15
|
+
},
|
|
16
|
+
transmission: {
|
|
17
|
+
type: 'string'
|
|
18
|
+
},
|
|
19
|
+
drivers: {
|
|
20
|
+
collection: 'driver',
|
|
21
|
+
via: 'taxis'
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
toJSON: function() {
|
|
25
|
+
var obj = this.toObject();
|
|
26
|
+
delete obj.medallion;
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
|
|
3
|
+
tableName: 'taxiWithSchemaTable',
|
|
4
|
+
meta: {
|
|
5
|
+
schemaName: 'bar'
|
|
6
|
+
},
|
|
7
|
+
identity: 'taxiwithschema',
|
|
8
|
+
|
|
9
|
+
attributes: {
|
|
10
|
+
medallion: {
|
|
11
|
+
type: 'integer'
|
|
12
|
+
},
|
|
13
|
+
drivers: {
|
|
14
|
+
collection: 'driver',
|
|
15
|
+
via: 'taxis'
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
toJSON: function() {
|
|
19
|
+
var obj = this.toObject();
|
|
20
|
+
delete obj.medallion;
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
module.exports.payment = {
|
|
2
|
+
|
|
3
|
+
tableName: 'payment_manyTable',
|
|
4
|
+
identity: 'payment_many',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
amount: {
|
|
8
|
+
type: 'integer'
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
customer: {
|
|
14
|
+
model: 'customer_many'
|
|
15
|
+
},
|
|
16
|
+
patron: {
|
|
17
|
+
model: 'customer_many'
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
toJSON: function() {
|
|
21
|
+
var obj = this.toObject();
|
|
22
|
+
delete obj.type;
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports.customer = {
|
|
30
|
+
|
|
31
|
+
tableName: 'customer_manyTable',
|
|
32
|
+
identity: 'customer_many',
|
|
33
|
+
|
|
34
|
+
attributes: {
|
|
35
|
+
name: {
|
|
36
|
+
type: 'string'
|
|
37
|
+
},
|
|
38
|
+
payments: {
|
|
39
|
+
collection: 'payment_many',
|
|
40
|
+
via: 'customer'
|
|
41
|
+
},
|
|
42
|
+
transactions: {
|
|
43
|
+
collection: 'payment_many',
|
|
44
|
+
via: 'patron'
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
toJSON: function() {
|
|
48
|
+
var obj = this.toObject();
|
|
49
|
+
delete obj.name;
|
|
50
|
+
return obj;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module.exports.user_resource = {
|
|
2
|
+
|
|
3
|
+
tableName: 'user_resourceManyTable',
|
|
4
|
+
identity: 'user_resourceMany',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
name: {
|
|
8
|
+
type: 'string'
|
|
9
|
+
},
|
|
10
|
+
quantity: {
|
|
11
|
+
type: 'integer'
|
|
12
|
+
},
|
|
13
|
+
profile: {
|
|
14
|
+
model: 'profileMany'
|
|
15
|
+
},
|
|
16
|
+
profilePvp: {
|
|
17
|
+
model: 'profileMany'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
module.exports.profile = {
|
|
24
|
+
|
|
25
|
+
tableName: 'profileManyTable',
|
|
26
|
+
identity: 'profileMany',
|
|
27
|
+
|
|
28
|
+
attributes: {
|
|
29
|
+
name: {
|
|
30
|
+
type: 'string'
|
|
31
|
+
},
|
|
32
|
+
level : {
|
|
33
|
+
type: 'integer'
|
|
34
|
+
},
|
|
35
|
+
user: {
|
|
36
|
+
model: 'user_resourceMany'
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
module.exports.team = {
|
|
2
|
+
|
|
3
|
+
tableName: 'teamManyTable',
|
|
4
|
+
identity: 'teamMany',
|
|
5
|
+
|
|
6
|
+
attributes: {
|
|
7
|
+
name: {
|
|
8
|
+
type: 'string'
|
|
9
|
+
},
|
|
10
|
+
mascot: {
|
|
11
|
+
type: 'string'
|
|
12
|
+
},
|
|
13
|
+
stadiums: {
|
|
14
|
+
collection: 'stadiumMany',
|
|
15
|
+
through: 'venueMany',
|
|
16
|
+
via: 'team'
|
|
17
|
+
},
|
|
18
|
+
nativeStadiums: {
|
|
19
|
+
collection: 'stadiumMany',
|
|
20
|
+
through: 'venueMany',
|
|
21
|
+
via: 'nativeTeam'
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
toJSON: function() {
|
|
25
|
+
var obj = this.toObject();
|
|
26
|
+
delete obj.mascot;
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports.stadium = {
|
|
34
|
+
|
|
35
|
+
tableName: 'stadiumManyTable',
|
|
36
|
+
identity: 'stadiumMany',
|
|
37
|
+
|
|
38
|
+
attributes: {
|
|
39
|
+
name: {
|
|
40
|
+
type: 'string'
|
|
41
|
+
},
|
|
42
|
+
teams: {
|
|
43
|
+
collection: 'teamMany',
|
|
44
|
+
through: 'venueMany',
|
|
45
|
+
via: 'stadium'
|
|
46
|
+
},
|
|
47
|
+
nativeTeams: {
|
|
48
|
+
collection: 'teamMany',
|
|
49
|
+
through: 'venueMany',
|
|
50
|
+
via: 'nativeStadium'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
module.exports.venue = {
|
|
57
|
+
|
|
58
|
+
tableName: 'venueManyTable',
|
|
59
|
+
identity: 'venueMany',
|
|
60
|
+
|
|
61
|
+
attributes: {
|
|
62
|
+
seats: {
|
|
63
|
+
type: 'integer'
|
|
64
|
+
},
|
|
65
|
+
team: {
|
|
66
|
+
model: 'teamMany'
|
|
67
|
+
},
|
|
68
|
+
nativeTeam: {
|
|
69
|
+
model: 'teamMany'
|
|
70
|
+
},
|
|
71
|
+
stadium: {
|
|
72
|
+
model: 'stadiumMany'
|
|
73
|
+
},
|
|
74
|
+
nativeStadium: {
|
|
75
|
+
model: 'stadiumMany'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
};
|