Преглед на файлове

feat: 移除 knex 配置和数据库迁移文件,更新 tsconfig.json 文件

zyh преди 1 година
родител
ревизия
ec6bb89019
променени са 3 файла, в които са добавени 6 реда и са изтрити 6 реда
  1. 2 2
      knexfile.js
  2. 3 3
      migrations/20240101000000_create_admin_user.js
  3. 1 1
      tsconfig.json

+ 2 - 2
knexfile.ts → knexfile.js

@@ -1,6 +1,6 @@
-import type { Knex } from "knex";
+/** @type {import('knex').Knex.Config} */
 
-const config: Knex.Config = {
+const config = {
   client: "sqlite3",
   connection: {
     filename: "./database.sqlite",

+ 3 - 3
migrations/20240101000000_create_admin_user.ts → migrations/20240101000000_create_admin_user.js

@@ -1,6 +1,6 @@
-import { Knex } from "knex";
+/** @type {import('knex').Knex} */
 
-export async function up(knex: Knex): Promise<void> {
+export async function up(knex) {
   await knex.schema.createTable("users", (table) => {
     table.increments("id").primary();
     table.string("username").notNullable().unique();
@@ -10,6 +10,6 @@ export async function up(knex: Knex): Promise<void> {
   });
 }
 
-export async function down(knex: Knex): Promise<void> {
+export async function down(knex) {
   await knex.schema.dropTable("users");
 }

+ 1 - 1
tsconfig.json

@@ -6,7 +6,7 @@
     "**/.server/**/*.tsx",
     "**/.client/**/*.ts",
     "**/.client/**/*.tsx"
-  ],
+, "knexfile.js" ],
   "compilerOptions": {
     "lib": ["DOM", "DOM.Iterable", "ES2022"],
     "types": ["@remix-run/node", "vite/client"],