Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#151 node db intrface #63

Merged
merged 28 commits into from
Apr 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1b30ee1
migrations by Georgi
Apr 17, 2018
7814de8
migrations by Nikolay
nikolayanastasovsg Apr 18, 2018
d81aca7
Merge branch 'feature/#149reAlignDbModelMigrations' of github.com:geo…
nikolayanastasovsg Apr 18, 2018
346b38b
Migrations by Nikolay (fix fsp to participant)
nikolayanastasovsg Apr 18, 2018
e107191
Migrations by Nikolay (fix the migration timestamp)
nikolayanastasovsg Apr 18, 2018
f024830
valentin's migrations
Apr 18, 2018
c2e9887
Renaming files with latest timestamps
Apr 18, 2018
ef59365
Cleaning out old migration scripts
Apr 18, 2018
3c2bdd2
Migrations by Deon
Apr 18, 2018
c1e7445
cleaning up
Apr 18, 2018
cf93307
Merging migration scripts 1
Apr 18, 2018
8e5fb82
Merging migration scripts 2
nikolayanastasovsg Apr 18, 2018
347a11f
Merging migration scripts 3
nikolayanastasovsg Apr 19, 2018
c9fbae1
Fixing migration scripts
nikolayanastasovsg Apr 19, 2018
9437f18
Rename migrations to singular
Apr 20, 2018
01d0311
renaming topic to event
Apr 20, 2018
ca4fc2b
Temporary disable Ledger account creation
Apr 20, 2018
d99860a
Finalize CDM changes
Apr 20, 2018
617c3cd
transfers renamed
Apr 24, 2018
2b1eb05
users -> party
Apr 24, 2018
6bca4d3
fews -> few
Apr 24, 2018
e738cab
before accounts
Apr 24, 2018
6f8721c
changed the currency table accordingly and seeded the currency codes
Apr 25, 2018
24f76f1
currencies with names added to seed script
Apr 25, 2018
809d9bc
trying to make it work
Apr 25, 2018
b151a7c
fixed permissions
Apr 25, 2018
e3df520
merge
Apr 25, 2018
2dcda8a
Merge branch 'feature/#207-auto-populate-currency-table' into feature…
Apr 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/knexfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict'

const migrationsDirectory = '../migrations'
const seedsDirectory = './seeds'

const Config = require('../src/lib/config')
module.exports = {
client: 'mysql',
Expand All @@ -9,5 +11,9 @@ module.exports = {
directory: migrationsDirectory,
tableName: 'migration',
stub: `${migrationsDirectory}/migration.template`
},
seeds: {
directory: seedsDirectory,
loadExtensions: ['.js']
}
}
3 changes: 1 addition & 2 deletions migrations/20180418100200_create-currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

exports.up = function(knex, Promise) {
return knex.schema.createTableIfNotExists('currency', (t) => {
t.increments('currencyId').primary().notNullable().notNullable()
t.string('code', 3).notNullable()
t.string('currencyId', 3).primary().notNullable()
t.string('name', 128).defaultTo(null).nullable()
})
}
Expand Down
2 changes: 0 additions & 2 deletions migrations/20180418100201_add-currency-indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

exports.up = function(knex, Promise) {
return knex.schema.table('currency', (t) => {
t.unique('code')
t.unique('name')
})
}

exports.down = function(knex, Promise) {
return knex.schema.table('currency', (t) => {
t.dropUnique('code')
t.dropUnique('name')
})
}
2 changes: 1 addition & 1 deletion migrations/20180418101100_create-participant.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports.up = function(knex, Promise) {
return knex.schema.createTableIfNotExists('participant', (t) => {
t.increments('participantId').primary().notNullable()

t.integer('currencyId').unsigned().notNullable()
t.string('currencyId', 3).notNullable()
t.foreign('currencyId').references('currencyId').inTable('currency')

t.string('name', 256).notNullable()
Expand Down
Loading