准备测试typeorm迁移

This commit is contained in:
SunnyQjm committed 2019-10-29 16:43:32 +08:00
1 parent 74eec6bfee
commit 2c74295872
5 files changed
+33 -6

No files matched your search

+13
View File
@@ -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
View File
@@ -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
View File
@@ -1,4 +1,4 @@
import { Injectable } from '@nestjs/common';
import { Injectable } from '@nestjs/common';
@Injectable()
export class AppService {
+2 -2
View File
@@ -14,7 +14,7 @@ export class Tag {
})
tagName: string;
@ManyToMany(type => Post, post => post.tags, {
})
@ManyToMany(type => Post, post => post.tags, {})
posts?: Post;
}
+13
View File
@@ -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"
}
}