0.7.1 • Published 3 years ago

nergal v0.7.1

Weekly downloads
21
License
ISC
Repository
-
Last release
3 years ago

Running tests

npm run test

Compilation

npm run compile

Project setup

Add following commands into the package.json scripts structure:

{
    "scripts": {
        "nergal": "node_modules/.bin/ts-node console.ts",
        "migrate": "node_modules/db-migrate/bin/db-migrate",
        "start": "node_modules/.bin/ts-node run.ts",
        "compile": "node_modules/typescript/bin/tsc --listEmittedFiles",
        "test": "node_modules/.bin/ts-node test/startup.ts && node_modules/.bin/mocha \"./test/*.test.ts\""
      },
}

Then init the project:

node node_modules/nergal/init

Migrations

To create new migration run

npm run migrate create <migration name>

Creating new table:

await db.createTable('votes', {
    id: { type: 'int', primaryKey: true, autoIncrement: true},
    participant_id: 'int',
    voter_discord_id: 'string',
  });

Adding indexes:

db.addIndex('votes', 'unique_voter_and_participant', ['participant_id', 'voter_discord_id'], true);

Dropping table

return db.dropTable('votes');

Adding column

await db.addColumn('votes', 'voter_discord_name', 'string');

Removing column

db.removeColumn('votes');

Running migrations

npm run migrate up

Running in dev mode

npm run start

Running console commands

npm run console 
0.7.1

3 years ago

0.7.0

3 years ago

0.6.4

3 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.0

4 years ago

0.5.1

4 years ago

0.4.0

4 years ago

0.3.6

4 years ago

0.3.7

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago