database
database copied to clipboard
Add line (general) notes, line footnotes, line pronunciation notes
- Allow different forms of the gurmukhi paath
- Padsheds and Vishrams will be linked to their respective variants.
- A field to enter in notes
Notes should include where SGPC saroops differ with themselves as well. Basically any research info that can help others in the future.
Notes field should be on by default in desktop app. Alternate Pad Shed option can be discussed after notes are filled out. Default pad shed should be some variation of SGPC.
Some random experiments:
Duplicating the lines column adds ~10MB.
Adding two random "padshed" columns with the same line data but randomised spaces adds ~20MB.
Script
const { random } = require( 'lodash' )
const { Lines, knex } = require( '..' )
const randomSpace = str => {
const index = random( 0, str.length - 1 )
return `${str.slice( 0, index )} ${str.slice( index )}`
}
const main = async () => {
const lines = await Lines.query().orderBy( 'order_id', 'desc' )
const newLines = lines.map( ( { id, gurmukhi } ) => {
// Add 3 random spaces
const padched1 = randomSpace( randomSpace( randomSpace( gurmukhi ) ) )
const padched2 = randomSpace( randomSpace( randomSpace( gurmukhi ) ) )
return { id, padched1, padched2 }
} )
await knex.transaction( trx => {
const queries = newLines.map( ( { id, ...rest } ) => Lines.query().where( 'id', id ).update( rest ).transacting( trx ) )
return Promise.all( queries ).then( trx.commit )
} )
}
main()
.then( () => process.exit( 0 ) )
.catch( async e => {
console.error( e.message )
console.error( e )
process.exit( 1 )
} )
Leaning towards adding new table which has overrides (with inline variation within object per line in JSON)
ANother option: create variation copy of data folder for each variant