mirror of
https://github.com/SunnyQjm/sunny-blog-server.git
synced 2026-10-04 19:52:21 +08:00
准备测试typeorm迁移
This commit is contained in:
1 parent
74eec6bfee
commit
2c74295872
5 files changed
+33
-6
No files matched your search
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "mysql",
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
"username": "sunny-blog",
|
||||
"password": "XkczhsZc3F5ZDhsi",
|
||||
"database": "sunny-blog",
|
||||
"entities": ["src/**/*.entity{.ts,.js}"],
|
||||
"migrations": ["src/migration/*.ts"],
|
||||
"cli": {
|
||||
"migrationsDir": "migration"
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -16,10 +16,11 @@ import { AdminModule } from './admin/admin.module';
|
||||
password: 'XkczhsZc3F5ZDhsi',
|
||||
database: 'sunny-blog',
|
||||
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
||||
logger: 'debug',
|
||||
logging: 'all',
|
||||
synchronize: true,
|
||||
migrationsRun: true,
|
||||
migrations: ['migration/*.ts'],
|
||||
cli: {
|
||||
migrationsDir: 'migration',
|
||||
},
|
||||
}), UserModule, AuthModule, PostModule, AdminModule],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
|
||||
@@ -14,7 +14,7 @@ export class Tag {
|
||||
})
|
||||
tagName: string;
|
||||
|
||||
@ManyToMany(type => Post, post => post.tags, {
|
||||
})
|
||||
@ManyToMany(type => Post, post => post.tags, {})
|
||||
posts?: Post;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "mysql",
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
"username": "sunny-blog",
|
||||
"password": "XkczhsZc3F5ZDhsi",
|
||||
"database": "sunny-blog",
|
||||
"entities": ["**/*.entity{.ts,.js}"],
|
||||
"migrations": ["migration/*.ts"],
|
||||
"cli": {
|
||||
"migrationsDir": "migration"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user