Pārlūkot izejas kodu

feat: Migrate on launch

Dale pirms 12 mēnešiem
vecāks
revīzija
2ec0c82598
  1. 2
      config/sqlite.json
  2. 12
      default.nix
  3. 5
      src/server/db/index.ts

2
config/sqlite.json

@ -1,6 +1,6 @@
{
"server": {
"port": 8080
"port": 8081
},
"database": {
"client": "sqlite",

12
default.nix

@ -3,12 +3,12 @@ with import <nixpkgs> {};
let
executableName = "miracle-tv-server";
version = "0.1.0";
src = fetchgit {
url = "https://code.gensokyo.social/Gensokyo.social/miracle-tv.git";
rev = "48f9d5aa30f0b1b29e44350307e63b009fc81996";
sha256 = "0yskcp63r3fcsv4my1f6z2262zk0cqb72k1qn04rwwz9s6ilzbr1";
};
# src = ./.;
# src = fetchgit {
# url = "https://code.gensokyo.social/Gensokyo.social/miracle-tv.git";
# rev = "48f9d5aa30f0b1b29e44350307e63b009fc81996";
# sha256 = "0yskcp63r3fcsv4my1f6z2262zk0cqb72k1qn04rwwz9s6ilzbr1";
# };
src = ./.;
nodePkg = pkgs.nodejs-14_x;
yarnPkg = pkgs.yarn.override { nodejs = nodePkg; };
in mkYarnPackage rec {

5
src/server/db/index.ts

@ -2,4 +2,7 @@ import Knex from 'knex';
import config from 'server/config';
export default Knex(config.database);
const knex = Knex(config.database);
knex.migrate.latest();
export default knex;
Notiek ielāde…
Atcelt
Saglabāt