refs #4823 Removed prefix for table names

This commit is contained in:
Guillermo Bonet 2023-05-03 19:46:40 +02:00
parent 355912fc57
commit bfe36b1284
16 changed files with 33 additions and 33 deletions

View File

@ -67,7 +67,7 @@ SYNC_TRADEITEM = true
### Foo.js
```javascript
import { Sequelize } from "sequelize";
import { Sequelize } from 'sequelize';
const bar = {
barCharacteristicOne: {
@ -83,7 +83,7 @@ const bar = {
export default (sequelize) => {
const Foo = sequelize.define(
"FDfoo",
"foo",
bar,
{
timestamps: false,

View File

@ -25,7 +25,7 @@ const clientConfig = {
export default (sequelize) => {
const ClientConfig = sequelize.define(
'FDClientConfig',
'clientConfig',
clientConfig,
{
timestamps: false,

View File

@ -23,7 +23,7 @@ const sequenceNumber = {
export default (sequelize) => {
const sequenceNumbers = sequelize.define(
'FDsequenceNumber',
'sequenceNumber',
sequenceNumber,
{
timestamps: false,

View File

@ -14,7 +14,7 @@ const connections = {
export default (sequelize) => {
const connection = sequelize.define(
'FDconnections',
'connections',
connections,
{
timestamps: false,

View File

@ -4,6 +4,12 @@ const suppliers = {
sequenceNumber: {
type: Sequelize.INTEGER,
allowNull: false,
primaryKey: true,
},
organizationId: {
type: Sequelize.STRING,
allowNull: false,
primaryKey: true,
},
companyGln: {
type: Sequelize.STRING,
@ -13,7 +19,6 @@ const suppliers = {
},
commercialName: {
type: Sequelize.STRING,
allowNull: false,
},
email: {
type: Sequelize.STRING,
@ -24,10 +29,6 @@ const suppliers = {
website: {
type: Sequelize.STRING,
},
organizationId: {
type: Sequelize.STRING,
primaryKey: true,
},
rfhRelationId: {
type: Sequelize.INTEGER,
},
@ -50,7 +51,7 @@ const suppliers = {
};
export default (sequelize) => {
const Suppliers = sequelize.define('FDsuppliers', suppliers, {
const Suppliers = sequelize.define('suppliers', suppliers, {
timestamps: false,
freezeTableName: true,
});

View File

@ -55,7 +55,7 @@ const supplyLine = {
export default (sequelize) => {
const SupplyLine = sequelize.define('FDsupplyLine', supplyLine, {
const SupplyLine = sequelize.define('supplyLine', supplyLine, {
timestamps: false,
freezeTableName: true,
});

View File

@ -15,7 +15,7 @@ const volumePrices = {
};
export default (sequelize) => {
const VolumePrices = sequelize.define('FDvolumePrices', volumePrices, {
const VolumePrices = sequelize.define('volumePrices', volumePrices, {
timestamps: false,
freezeTableName: true,
});

View File

@ -7,7 +7,7 @@ const botanicalNames = {
};
export default (sequelize) => {
const BotanicalNames = sequelize.define('FDbotanicalNames', botanicalNames, {
const BotanicalNames = sequelize.define('botanicalNames', botanicalNames, {
timestamps: false,
freezeTableName: true,
});

View File

@ -11,7 +11,7 @@ const characteristics = {
export default (sequelize) => {
const Characteristics = sequelize.define(
'FDcharacteristics',
'characteristics',
characteristics,
{
timestamps: false,

View File

@ -8,7 +8,7 @@ const countryOfOriginIsoCodes = {
export default (sequelize) => {
const CountryOfOriginIsoCodes = sequelize.define(
'FDcountryOfOriginIsoCodes',
'countryOfOriginIsoCodes',
countryOfOriginIsoCodes,
{
timestamps: false,

View File

@ -10,7 +10,7 @@ const PackageModel = {
};
export default (sequelize) => {
const Package = sequelize.define('FDpackage', PackageModel, {
const Package = sequelize.define('package', PackageModel, {
timestamps: false,
freezeTableName: true,
});

View File

@ -36,7 +36,7 @@ const packingConfigurations = {
export default (sequelize) => {
const PackingConfigurations = sequelize.define(
'FDpackingConfigurations',
'packingConfig',
packingConfigurations,
{
timestamps: false,

View File

@ -17,7 +17,7 @@ const photos = {
};
export default (sequelize) => {
const Photos = sequelize.define('FDphotos', photos, {
const Photos = sequelize.define('photos', photos, {
timestamps: false,
freezeTableName: true,
});

View File

@ -15,7 +15,7 @@ const seasonalPeriod = {
};
export default (sequelize) => {
const SeasonalPeriod = sequelize.define('FDseasonalPeriod', seasonalPeriod, {
const SeasonalPeriod = sequelize.define('seasonalPeriod', seasonalPeriod, {
timestamps: false,
freezeTableName: true,
});

View File

@ -38,7 +38,7 @@ const tradeItem = {
};
export default (sequelize) => {
const TradeItem = sequelize.define('FDtradeItem', tradeItem, {
const TradeItem = sequelize.define('tradeItem', tradeItem, {
timestamps: false,
freezeTableName: true,
});

View File

@ -273,17 +273,17 @@ export async function syncSuppliers(){
await models.supplier.upsert({
sequenceNumber: supplier.sequenceNumber,
companyGln: supplier.companyGln,
name: supplier.name,
commercialName: supplier.commercialName,
email: supplier.email,
phone: supplier.phone,
website: supplier.website,
organizationId: supplier.organizationId,
rfhRelationId: supplier.rfhRelationId,
paymentProviders: `${supplier.paymentProviders}`,
endDate: supplier.endDate,
mailingAddress: supplier.mailingAddress,
physicalAddress: supplier.physicalAddress,
name: supplier.name ? supplier.name : null,
commercialName: supplier.commercialName ? supplier.commercialName : null,
email: supplier.email ? supplier.email : null,
phone: supplier.phone ? supplier.phone : null,
website: supplier.website ? supplier.website : null,
organizationId: supplier.organizationId ? supplier.organizationId : null,
rfhRelationId: supplier.rfhRelationId ? supplier.rfhRelationId : null,
paymentProviders: supplier.paymentProviders.length ? `${supplier.paymentProviders}` : null,
endDate: supplier.endDate ? supplier.endDate : null,
mailingAddress: supplier.mailingAddress ? supplier.mailingAddress : null,
physicalAddress: supplier.physicalAddress ? supplier.physicalAddress : null,
});
};
await syncSequence(curSequenceNumber, 'suppliers', maxSequenceNumber);
@ -616,7 +616,6 @@ export async function insertItem(tradeItem, supplier) {
},
{transaction: tx});
let characteristics = tradeItem.characteristics;
for (let characteristic of characteristics) {