-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
14 changed files
with
244 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Objection Model for Languages. | ||
* @ignore | ||
*/ | ||
|
||
const { Model } = require( 'objection' ) | ||
|
||
const BaseModel = require( './BaseModel' ) | ||
|
||
class Languages extends BaseModel { | ||
static get tableName() { | ||
return 'Languages' | ||
} | ||
|
||
static get relationMappings() { | ||
return { | ||
translationSources: { | ||
relation: Model.HasManyRelation, | ||
join: { | ||
from: 'Languages.id', | ||
to: 'Translation_Source.language_id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Lines' ), | ||
}, | ||
} | ||
} | ||
} | ||
|
||
module.exports = Languages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Objection Model for Sections. | ||
* @ignore | ||
*/ | ||
|
||
const { Model } = require( 'objection' ) | ||
|
||
const BaseModel = require( './BaseModel' ) | ||
|
||
class Sections extends BaseModel { | ||
static get tableName() { | ||
return 'Sections' | ||
} | ||
|
||
static get relationMappings() { | ||
return { | ||
shabads: { | ||
relation: Model.HasManyRelation, | ||
join: { | ||
from: 'Sections.id', | ||
to: 'Shabads.section_id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Shabads' ), | ||
}, | ||
subsections: { | ||
relation: Model.HasManyRelation, | ||
join: { | ||
from: 'Sections.subsection_id', | ||
to: 'Subsections.id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Subsections' ), | ||
}, | ||
} | ||
} | ||
} | ||
|
||
module.exports = Sections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Objection Model for Subsections. | ||
* @ignore | ||
*/ | ||
|
||
const { Model } = require( 'objection' ) | ||
|
||
const BaseModel = require( './BaseModel' ) | ||
|
||
class Subsections extends BaseModel { | ||
static get tableName() { | ||
return 'Subsections' | ||
} | ||
|
||
static get relationMappings() { | ||
return { | ||
shabads: { | ||
relation: Model.HasManyRelation, | ||
join: { | ||
from: 'Subsections.id', | ||
to: 'Shabads.subsection_id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Shabads' ) | ||
}, | ||
section: { | ||
relation: Model.BelongsToOneRelation, | ||
join: { | ||
from: 'Subsections.section_id', | ||
to: 'Sections.id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Sections' ) | ||
}, | ||
} | ||
} | ||
} | ||
|
||
module.exports = Subsections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Objection Model for Translation Sources. | ||
* @ignore | ||
*/ | ||
|
||
const { Model } = require( 'objection' ) | ||
|
||
const BaseModel = require( './BaseModel' ) | ||
|
||
class TranslationSources extends BaseModel { | ||
static get tableName() { | ||
return 'Translation_Sources' | ||
} | ||
|
||
static get relationMappings() { | ||
return { | ||
source: { | ||
relation: Model.BelongsToOneRelation, | ||
join: { | ||
from: 'Translation_Sources.source_id', | ||
to: 'Sources.id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Sources' ), | ||
}, | ||
translations: { | ||
relation: Model.HasManyRelation, | ||
join: { | ||
from: 'Translation_Sources.id', | ||
to: 'Translations.translation_source_id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Translations' ), | ||
}, | ||
language: { | ||
relation: Model.HasOneRelation, | ||
join: { | ||
from: 'Translation_Sources.langauge_id', | ||
to: 'Languages.id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Languages' ), | ||
}, | ||
} | ||
} | ||
} | ||
|
||
module.exports = TranslationSources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Objection Model for Translations. | ||
* @ignore | ||
*/ | ||
|
||
const { Model } = require( 'objection' ) | ||
|
||
const BaseModel = require( './BaseModel' ) | ||
|
||
class Translations extends BaseModel { | ||
static get tableName() { | ||
return 'Translations' | ||
} | ||
|
||
static get relationMappings() { | ||
return { | ||
lines: { | ||
relation: Model.BelongsToOneRelation, | ||
join: { | ||
from: 'Translations.line_id', | ||
to: 'Lines.id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './Lines' ), | ||
}, | ||
translationSource: { | ||
relation: Model.BelongsToOneRelation, | ||
join: { | ||
from: 'Translations.translation_source_id', | ||
to: 'Translation_Sources.id', | ||
}, | ||
// eslint-disable-next-line | ||
modelClass: require( './TranslationSources' ), | ||
}, | ||
} | ||
} | ||
} | ||
|
||
module.exports = Translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.