mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
lint: fix offenses for @typescript-eslint/no-unused-vars rule in tests folder (#11755)
This commit is contained in:
parent
69dfc42eb9
commit
08a9397491
@ -11,12 +11,12 @@ export class Counters {
|
||||
@Column()
|
||||
favorites: number
|
||||
|
||||
@Column((type) => Information, { prefix: "info" })
|
||||
@Column(() => Information, { prefix: "info" })
|
||||
information: Information
|
||||
|
||||
@Column((type) => Information, { prefix: "testData" })
|
||||
@Column(() => Information, { prefix: "testData" })
|
||||
data: Information
|
||||
|
||||
@Column((type) => Information, { prefix: "" })
|
||||
@Column(() => Information, { prefix: "" })
|
||||
dataWithoutPrefix: Information
|
||||
}
|
||||
|
||||
@ -14,12 +14,12 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters
|
||||
|
||||
@Column((type) => Counters, { prefix: "testCounters" })
|
||||
@Column(() => Counters, { prefix: "testCounters" })
|
||||
otherCounters: Counters
|
||||
|
||||
@Column((type) => Counters, { prefix: "" })
|
||||
@Column(() => Counters, { prefix: "" })
|
||||
countersWithoutPrefix: Counters
|
||||
}
|
||||
|
||||
@ -11,6 +11,6 @@ export class SimpleCounters {
|
||||
@Column()
|
||||
favorites: number
|
||||
|
||||
@Column((type) => Information, { prefix: "info" })
|
||||
@Column(() => Information, { prefix: "info" })
|
||||
information: Information
|
||||
}
|
||||
|
||||
@ -14,6 +14,6 @@ export class SimplePost {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@Column((type) => SimpleCounters)
|
||||
@Column(() => SimpleCounters)
|
||||
counters: SimpleCounters
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { EventSubscriber } from "../../../../../../src/decorator/listeners/EventSubscriber"
|
||||
import { EntitySubscriberInterface } from "../../../../../../src/subscriber/EntitySubscriberInterface"
|
||||
import { InsertEvent } from "../../../../../../src/subscriber/event/InsertEvent"
|
||||
|
||||
@EventSubscriber()
|
||||
export class TestBlogSubscriber implements EntitySubscriberInterface {
|
||||
/**
|
||||
* Called after entity insertion.
|
||||
*/
|
||||
beforeInsert(event: InsertEvent<any>) {
|
||||
beforeInsert() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { EventSubscriber } from "../../../../../../src/decorator/listeners/EventSubscriber"
|
||||
import { EntitySubscriberInterface } from "../../../../../../src/subscriber/EntitySubscriberInterface"
|
||||
import { InsertEvent } from "../../../../../../src/subscriber/event/InsertEvent"
|
||||
|
||||
@EventSubscriber()
|
||||
export class TestQuestionSubscriber implements EntitySubscriberInterface {
|
||||
/**
|
||||
* Called before entity insertion.
|
||||
*/
|
||||
beforeInsert(event: InsertEvent<any>) {
|
||||
beforeInsert() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { EventSubscriber } from "../../../../../../src/decorator/listeners/EventSubscriber"
|
||||
import { EntitySubscriberInterface } from "../../../../../../src/subscriber/EntitySubscriberInterface"
|
||||
import { InsertEvent } from "../../../../../../src/subscriber/event/InsertEvent"
|
||||
|
||||
@EventSubscriber()
|
||||
export class TestVideoSubscriber implements EntitySubscriberInterface {
|
||||
/**
|
||||
* Called after entity insertion.
|
||||
*/
|
||||
beforeInsert(event: InsertEvent<any>) {
|
||||
beforeInsert() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { EntitySubscriberInterface } from "../../../../src/subscriber/EntitySubscriberInterface"
|
||||
import { EventSubscriber } from "../../../../src/decorator/listeners/EventSubscriber"
|
||||
import { InsertEvent } from "../../../../src/subscriber/event/InsertEvent"
|
||||
|
||||
@EventSubscriber()
|
||||
export class FirstConnectionSubscriber implements EntitySubscriberInterface {
|
||||
/**
|
||||
* Called after entity insertion.
|
||||
*/
|
||||
beforeInsert(event: InsertEvent<any>) {
|
||||
beforeInsert() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
import { EntitySubscriberInterface } from "../../../../src/subscriber/EntitySubscriberInterface"
|
||||
import { EventSubscriber } from "../../../../src/decorator/listeners/EventSubscriber"
|
||||
import { InsertEvent } from "../../../../src/subscriber/event/InsertEvent"
|
||||
|
||||
@EventSubscriber()
|
||||
export class SecondConnectionSubscriber implements EntitySubscriberInterface {
|
||||
/**
|
||||
* Called after entity insertion.
|
||||
*/
|
||||
beforeInsert(event: InsertEvent<any>) {
|
||||
beforeInsert() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,10 +18,10 @@ export class Category {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Image, (image) => image.categories)
|
||||
@ManyToMany(() => Image, (image) => image.categories)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ export class Image {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.images)
|
||||
@ManyToMany(() => Category, (category) => category.images)
|
||||
categories: Category[]
|
||||
|
||||
@RelationCount((image: Image) => image.categories)
|
||||
|
||||
@ -17,7 +17,7 @@ export class Post {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
|
||||
@ -18,10 +18,10 @@ export class Category {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Image)
|
||||
@ManyToMany(() => Image)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
|
||||
|
||||
@ -17,11 +17,11 @@ export class Post {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
subcategories: Category[]
|
||||
|
||||
|
||||
@ -16,6 +16,6 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@Column((type) => PostInformation, { prefix: "info" })
|
||||
@Column(() => PostInformation, { prefix: "info" })
|
||||
information: PostInformation = new PostInformation()
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ export class PostInformation {
|
||||
@Index()
|
||||
description: string
|
||||
|
||||
@Column((type) => PostCounter, { prefix: "counters" })
|
||||
@Column(() => PostCounter, { prefix: "counters" })
|
||||
counters: PostCounter = new PostCounter()
|
||||
|
||||
@BeforeInsert()
|
||||
|
||||
@ -20,7 +20,7 @@ export class Counters {
|
||||
@Column(() => Subcounters, { prefix: "subcnt" })
|
||||
subcounters: Subcounters
|
||||
|
||||
@ManyToMany((type) => User, (user) => user.likedPosts)
|
||||
@ManyToMany(() => User, (user) => user.likedPosts)
|
||||
@JoinTable()
|
||||
likedUsers: User[]
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ export class User {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
|
||||
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
|
||||
likedPosts: Post[]
|
||||
}
|
||||
|
||||
@ -19,6 +19,6 @@ export class Counters {
|
||||
@Column(() => Subcounters, { prefix: "subcnt" })
|
||||
subcounters: Subcounters
|
||||
|
||||
@ManyToMany((type) => User, (user) => user.likedPosts)
|
||||
@ManyToMany(() => User, (user) => user.likedPosts)
|
||||
likedUsers: User[]
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export class User {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
|
||||
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
|
||||
@JoinTable()
|
||||
likedPosts: Post[]
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ export class Counters {
|
||||
@Column(() => Subcounters, { prefix: "subcnt" })
|
||||
subcounters: Subcounters
|
||||
|
||||
@ManyToMany((type) => User, (user) => user.likedPosts)
|
||||
@ManyToMany(() => User, (user) => user.likedPosts)
|
||||
@JoinTable()
|
||||
likedUsers: User[]
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ export class User {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
|
||||
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
|
||||
likedPosts: Post[]
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ export class Counters {
|
||||
@Column(() => Subcounters, { prefix: "subcnt" })
|
||||
subcounters: Subcounters
|
||||
|
||||
@ManyToMany((type) => User, (user) => user.likedPosts)
|
||||
@ManyToMany(() => User, (user) => user.likedPosts)
|
||||
@JoinTable()
|
||||
likedUsers: User[]
|
||||
}
|
||||
|
||||
@ -15,6 +15,6 @@ export class User {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
|
||||
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
|
||||
likedPosts: Post[]
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ export class Counters {
|
||||
@Column(() => Subcounters, { prefix: "subcnt" })
|
||||
subcounters: Subcounters
|
||||
|
||||
@ManyToMany((type) => User, (user) => user.likedPosts)
|
||||
@ManyToMany(() => User, (user) => user.likedPosts)
|
||||
@JoinTable()
|
||||
likedUsers: User[]
|
||||
}
|
||||
|
||||
@ -15,6 +15,6 @@ export class User {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
|
||||
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
|
||||
likedPosts: Post[]
|
||||
}
|
||||
|
||||
@ -16,6 +16,6 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@Column((type) => PostInformation, { prefix: "info" })
|
||||
@Column(() => PostInformation, { prefix: "info" })
|
||||
information?: PostInformation
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ export class PostInformation {
|
||||
@Column({ nullable: true })
|
||||
description?: string
|
||||
|
||||
@Column((type) => PostCounter, { prefix: "counters" })
|
||||
@Column(() => PostCounter, { prefix: "counters" })
|
||||
counters?: PostCounter
|
||||
|
||||
@BeforeInsert()
|
||||
|
||||
@ -17,7 +17,7 @@ export class Post {
|
||||
@OneToOne(() => Category)
|
||||
category: Category
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
category2: Category
|
||||
|
||||
@RelationCount((post: Post) => post.category)
|
||||
|
||||
@ -19,7 +19,7 @@ export class Post {
|
||||
@JoinColumn()
|
||||
category: Category
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Category[] = []
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export class Question {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@ManyToMany((type) => Category, { persistence: false })
|
||||
@ManyToMany(() => Category, { persistence: false })
|
||||
@JoinTable()
|
||||
categories: Category[] = []
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ export class Counters {
|
||||
@Column(() => Subcounters, { prefix: "sub" })
|
||||
subcounters: Subcounters
|
||||
|
||||
@ManyToMany((type) => User, (user) => user.likedPosts)
|
||||
@ManyToMany(() => User, (user) => user.likedPosts)
|
||||
@JoinTable()
|
||||
likedUsers: User[]
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ export class Subcounters {
|
||||
@Column()
|
||||
watches: number
|
||||
|
||||
@ManyToMany((type) => User)
|
||||
@ManyToMany(() => User)
|
||||
@JoinTable({ name: "post_cnt_subcnt_wtch_users" })
|
||||
watchedUsers: User[]
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ export class User {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.likedUsers)
|
||||
@ManyToMany(() => Post, (post) => post.counters.likedUsers)
|
||||
likedPosts: Post[]
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ export class Post extends BaseEntity {
|
||||
})
|
||||
text: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ export class Post extends BaseEntity {
|
||||
})
|
||||
text: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { MigrationInterface } from "../../../../../src/migration/MigrationInterface"
|
||||
import { QueryRunner } from "../../../../../src/query-runner/QueryRunner"
|
||||
|
||||
export class ExampleMigration1530542855524 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {}
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {}
|
||||
public async up() {}
|
||||
public async down() {}
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import { MigrationInterface } from "../../../../../src/migration/MigrationInterface"
|
||||
import { QueryRunner } from "../../../../../src/query-runner/QueryRunner"
|
||||
|
||||
export class ExampleMigrationTwo1530542855524 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {}
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {}
|
||||
public async up() {}
|
||||
public async down() {}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ export class Post {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters[]
|
||||
|
||||
@Column()
|
||||
@ -24,9 +24,9 @@ export class Post {
|
||||
@Column()
|
||||
booleans: boolean[]
|
||||
|
||||
@Column((type) => Counters, { array: true })
|
||||
@Column(() => Counters, { array: true })
|
||||
other1: Counters[]
|
||||
|
||||
@Column((type) => Counters, { array: true })
|
||||
@Column(() => Counters, { array: true })
|
||||
other2: Counters[]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ export class Counters {
|
||||
@Column()
|
||||
likes: number
|
||||
|
||||
@Column((type) => Information)
|
||||
@Column(() => Information)
|
||||
information?: Information
|
||||
|
||||
@BeforeInsert()
|
||||
|
||||
@ -16,9 +16,9 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters?: Counters
|
||||
|
||||
@Column((type) => Tags)
|
||||
@Column(() => Tags)
|
||||
tags?: Tags[]
|
||||
}
|
||||
|
||||
@ -12,9 +12,9 @@ export class Counters {
|
||||
@Column()
|
||||
favorites: number
|
||||
|
||||
@Column((type) => Information)
|
||||
@Column(() => Information)
|
||||
information: Information
|
||||
|
||||
@Column((type) => ExtraInformation)
|
||||
@Column(() => ExtraInformation)
|
||||
extraInformation: ExtraInformation
|
||||
}
|
||||
|
||||
@ -2,6 +2,6 @@ import { Column } from "../../../../../../src/decorator/columns/Column"
|
||||
import { EditHistory } from "./EditHistory"
|
||||
|
||||
export class ExtraInformation {
|
||||
@Column((type) => EditHistory)
|
||||
@Column(() => EditHistory)
|
||||
lastEdit: EditHistory
|
||||
}
|
||||
|
||||
@ -15,6 +15,6 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ describe("multi-database > basic-functionality", () => {
|
||||
|
||||
it("should correctly attach and create database files", () =>
|
||||
Promise.all(
|
||||
connections.map(async (connection) => {
|
||||
connections.map(async () => {
|
||||
const expectedMainPath = path.join(
|
||||
tempPath,
|
||||
(connections[0].options.database as string).match(
|
||||
|
||||
@ -15,7 +15,7 @@ export class Post {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable({ database: "yoman" })
|
||||
categories: Category[]
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ export class Post {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable({ schema: "yoman" })
|
||||
categories: Category[]
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ export class Category {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export class Post {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts, {
|
||||
@ManyToMany(() => Category, (category) => category.posts, {
|
||||
cascade: ["insert"],
|
||||
})
|
||||
@JoinTable()
|
||||
|
||||
@ -19,7 +19,7 @@ export class User {
|
||||
@OneToMany(() => Photo, (photo) => photo.user, { cascade: true })
|
||||
manyPhotos: Photo[]
|
||||
|
||||
@ManyToMany((type) => Photo, { cascade: true })
|
||||
@ManyToMany(() => Photo, { cascade: true })
|
||||
@JoinTable()
|
||||
manyToManyPhotos: Photo[]
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ export class User {
|
||||
@OneToMany(() => Photo, (photo) => photo.user, { cascade: true })
|
||||
manyPhotos: Photo[]
|
||||
|
||||
@ManyToMany((type) => Photo, { cascade: true })
|
||||
@ManyToMany(() => Photo, { cascade: true })
|
||||
@JoinTable()
|
||||
manyToManyPhotos: Photo[]
|
||||
}
|
||||
|
||||
@ -11,6 +11,6 @@ export class PostComplex {
|
||||
@Column({ default: "Hello Complexity" })
|
||||
text: string
|
||||
|
||||
@Column((type) => PostEmbedded)
|
||||
@Column(() => PostEmbedded)
|
||||
embed: PostEmbedded
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ export class Category {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export class Post {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[] | null
|
||||
}
|
||||
|
||||
@ -15,6 +15,6 @@ export class Category {
|
||||
@Column()
|
||||
position: number
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
}
|
||||
|
||||
@ -17,10 +17,10 @@ export class Post {
|
||||
@Column()
|
||||
description: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts, {
|
||||
@ManyToMany(() => Category, (category) => category.posts, {
|
||||
cascade: ["update"],
|
||||
})
|
||||
@JoinTable()
|
||||
|
||||
@ -11,6 +11,6 @@ export class Photo {
|
||||
@Column()
|
||||
url: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters
|
||||
}
|
||||
|
||||
@ -11,6 +11,6 @@ export class Photo {
|
||||
@Column()
|
||||
url: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters
|
||||
}
|
||||
|
||||
@ -17,10 +17,10 @@ export class Category {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Image)
|
||||
@ManyToMany(() => Image)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ export class Post {
|
||||
@JoinColumn()
|
||||
author: User
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
|
||||
@ -17,10 +17,10 @@ export class Category {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Image)
|
||||
@ManyToMany(() => Image)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ export class Post {
|
||||
@JoinColumn()
|
||||
author: User
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
|
||||
@ -17,10 +17,10 @@ export class Category {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Image, (image) => image.categories)
|
||||
@ManyToMany(() => Image, (image) => image.categories)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ export class Image {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.images)
|
||||
@ManyToMany(() => Category, (category) => category.images)
|
||||
categories: Category[]
|
||||
|
||||
categoryCount: number
|
||||
|
||||
@ -16,7 +16,7 @@ export class Post {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
|
||||
@ -14,10 +14,10 @@ export class Category {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Image)
|
||||
@ManyToMany(() => Image)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
|
||||
|
||||
@ -20,11 +20,11 @@ export class Post {
|
||||
|
||||
tagId: number
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
subcategories: Category[]
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ export class Category {
|
||||
@PrimaryColumn()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.categories)
|
||||
@ManyToMany(() => Post, (post) => post.counters.categories)
|
||||
posts: Post[]
|
||||
|
||||
postIds: number[]
|
||||
|
||||
@ -18,7 +18,7 @@ export class Counters {
|
||||
@Column()
|
||||
favorites: number
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable({ name: "counter_categories" })
|
||||
categories: Category[]
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ export class Subcounters {
|
||||
@Column()
|
||||
watches: number
|
||||
|
||||
@ManyToMany((type) => User, (user) => user.posts)
|
||||
@ManyToMany(() => User, (user) => user.posts)
|
||||
@JoinTable({ name: "subcnt_users" })
|
||||
watchedUsers: User[]
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ export class User {
|
||||
@PrimaryColumn()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.subcntrs.watchedUsers)
|
||||
@ManyToMany(() => Post, (post) => post.counters.subcntrs.watchedUsers)
|
||||
posts: Post[]
|
||||
|
||||
postIds: number[]
|
||||
|
||||
@ -12,7 +12,7 @@ export class Category {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.counters.categories)
|
||||
@ManyToMany(() => Post, (post) => post.counters.categories)
|
||||
posts: Post[]
|
||||
|
||||
postIds: number[]
|
||||
|
||||
@ -14,7 +14,7 @@ export class Counters {
|
||||
@Column()
|
||||
favorites: number
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable({ name: "counter_categories" })
|
||||
categories: Category[]
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ export class Subcounters {
|
||||
@Column()
|
||||
watches: number
|
||||
|
||||
@ManyToMany((type) => User)
|
||||
@ManyToMany(() => User)
|
||||
@JoinTable({ name: "subcnt_users" })
|
||||
watchedUsers: User[]
|
||||
|
||||
|
||||
@ -20,10 +20,10 @@ export class Category {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Image, (image) => image.categories)
|
||||
@ManyToMany(() => Image, (image) => image.categories)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ export class Image {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.images)
|
||||
@ManyToMany(() => Category, (category) => category.images)
|
||||
categories: Category[]
|
||||
|
||||
categoryIds: number[]
|
||||
|
||||
@ -19,11 +19,11 @@ export class Post {
|
||||
@Column()
|
||||
isRemoved: boolean = false
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
subcategories: Category[]
|
||||
|
||||
|
||||
@ -12,6 +12,6 @@ export class Image {
|
||||
@Column()
|
||||
url: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.images)
|
||||
@ManyToMany(() => Post, (post) => post.images)
|
||||
posts: Post[]
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ export class Post {
|
||||
@ManyToOne(() => Category, (category) => category.posts)
|
||||
category: Category
|
||||
|
||||
@ManyToMany((type) => Image, (image) => image.posts)
|
||||
@ManyToMany(() => Image, (image) => image.posts)
|
||||
@JoinTable()
|
||||
images: Image[]
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ export class Photo {
|
||||
@Column()
|
||||
url: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters
|
||||
|
||||
@DeleteDateColumn()
|
||||
|
||||
@ -13,7 +13,7 @@ export class Post {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
}
|
||||
|
||||
@ -11,6 +11,6 @@ export class Photo {
|
||||
@Column()
|
||||
url: string
|
||||
|
||||
@Column((type) => Counters)
|
||||
@Column(() => Counters)
|
||||
counters: Counters
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export class Category {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories2)
|
||||
@ManyToMany(() => Post, (post) => post.categories2)
|
||||
@JoinTable()
|
||||
posts2: Post[]
|
||||
}
|
||||
|
||||
@ -17,11 +17,11 @@ export class Post {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@ManyToMany((type) => Category, { eager: true })
|
||||
@ManyToMany(() => Category, { eager: true })
|
||||
@JoinTable()
|
||||
categories1: Category[]
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts2, {
|
||||
@ManyToMany(() => Category, (category) => category.posts2, {
|
||||
eager: true,
|
||||
})
|
||||
categories2: Category[]
|
||||
|
||||
@ -13,7 +13,7 @@ export class Category {
|
||||
@Column()
|
||||
name: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories2)
|
||||
@ManyToMany(() => Post, (post) => post.categories2)
|
||||
@JoinTable()
|
||||
posts2: Post[]
|
||||
}
|
||||
|
||||
@ -17,11 +17,11 @@ export class Post {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@ManyToMany((type) => Category, { eager: true })
|
||||
@ManyToMany(() => Category, { eager: true })
|
||||
@JoinTable()
|
||||
categories1: Category[]
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts2, {
|
||||
@ManyToMany(() => Category, (category) => category.posts2, {
|
||||
eager: true,
|
||||
})
|
||||
categories2: Category[]
|
||||
|
||||
@ -17,7 +17,7 @@ export class Category {
|
||||
@OneToOne(() => Post, (post) => post.oneCategory)
|
||||
onePost: Promise<Post>
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
|
||||
@ManyToMany(() => Post, (post) => post.twoSideCategories)
|
||||
twoSidePosts: Promise<Post[]>
|
||||
|
||||
@OneToMany(() => Post, (post) => post.twoSideCategory)
|
||||
|
||||
@ -19,11 +19,11 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Promise<Category[]>
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
|
||||
@ManyToMany(() => Category, (category) => category.twoSidePosts)
|
||||
@JoinTable()
|
||||
twoSideCategories: Promise<Category[]>
|
||||
|
||||
|
||||
@ -19,14 +19,14 @@ export class Category {
|
||||
@OneToOne(() => Post, (post) => post.oneCategory)
|
||||
onePost: Promise<Post>
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
|
||||
@ManyToMany(() => Post, (post) => post.twoSideCategories)
|
||||
twoSidePosts: Promise<Post[]>
|
||||
|
||||
@OneToMany(() => Post, (post) => post.twoSideCategory)
|
||||
twoSidePosts2: Promise<Post[]>
|
||||
|
||||
// ManyToMany with named properties
|
||||
@ManyToMany((type) => Post, (post) => post.categoriesNamedColumn)
|
||||
@ManyToMany(() => Post, (post) => post.categoriesNamedColumn)
|
||||
postsNamedColumn: Promise<Post[]>
|
||||
|
||||
// OneToMany with named properties
|
||||
|
||||
@ -21,11 +21,11 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Promise<Category[]>
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
|
||||
@ManyToMany(() => Category, (category) => category.twoSidePosts)
|
||||
@JoinTable()
|
||||
twoSideCategories: Promise<Category[]>
|
||||
|
||||
@ -43,7 +43,7 @@ export class Post {
|
||||
twoSideCategory: Promise<Category>
|
||||
|
||||
// ManyToMany with named properties
|
||||
@ManyToMany((type) => Category, (category) => category.postsNamedColumn)
|
||||
@ManyToMany(() => Category, (category) => category.postsNamedColumn)
|
||||
@JoinTable()
|
||||
categoriesNamedColumn: Promise<Category[]>
|
||||
|
||||
|
||||
@ -23,14 +23,14 @@ export class Category {
|
||||
@OneToOne(() => Post, (post) => post.oneCategory)
|
||||
onePost: Promise<Post>
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
|
||||
@ManyToMany(() => Post, (post) => post.twoSideCategories)
|
||||
twoSidePosts: Promise<Post[]>
|
||||
|
||||
@OneToMany(() => Post, (post) => post.twoSideCategory)
|
||||
twoSidePosts2: Promise<Post[]>
|
||||
|
||||
// ManyToMany with named properties
|
||||
@ManyToMany((type) => Post, (post) => post.categoriesNamedAll)
|
||||
@ManyToMany(() => Post, (post) => post.categoriesNamedAll)
|
||||
postsNamedAll: Promise<Post[]>
|
||||
|
||||
// OneToMany with named properties
|
||||
|
||||
@ -26,11 +26,11 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Promise<Category[]>
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
|
||||
@ManyToMany(() => Category, (category) => category.twoSidePosts)
|
||||
@JoinTable()
|
||||
twoSideCategories: Promise<Category[]>
|
||||
|
||||
@ -48,7 +48,7 @@ export class Post {
|
||||
twoSideCategory: Promise<Category>
|
||||
|
||||
// ManyToMany with named properties
|
||||
@ManyToMany((type) => Category, (category) => category.postsNamedAll)
|
||||
@ManyToMany(() => Category, (category) => category.postsNamedAll)
|
||||
@JoinTable()
|
||||
categoriesNamedAll: Promise<Category[]>
|
||||
|
||||
|
||||
@ -21,14 +21,14 @@ export class Category {
|
||||
@OneToOne(() => Post, (post) => post.oneCategory)
|
||||
onePost: Promise<Post>
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.twoSideCategories)
|
||||
@ManyToMany(() => Post, (post) => post.twoSideCategories)
|
||||
twoSidePosts: Promise<Post[]>
|
||||
|
||||
@OneToMany(() => Post, (post) => post.twoSideCategory)
|
||||
twoSidePosts2: Promise<Post[]>
|
||||
|
||||
// ManyToMany with named properties
|
||||
@ManyToMany((type) => Post, (post) => post.categoriesNamedTable)
|
||||
@ManyToMany(() => Post, (post) => post.categoriesNamedTable)
|
||||
postsNamedTable: Promise<Post[]>
|
||||
|
||||
// OneToMany with named properties
|
||||
|
||||
@ -24,11 +24,11 @@ export class Post {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Promise<Category[]>
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.twoSidePosts)
|
||||
@ManyToMany(() => Category, (category) => category.twoSidePosts)
|
||||
@JoinTable()
|
||||
twoSideCategories: Promise<Category[]>
|
||||
|
||||
@ -46,7 +46,7 @@ export class Post {
|
||||
twoSideCategory: Promise<Category>
|
||||
|
||||
// ManyToMany with named properties
|
||||
@ManyToMany((type) => Category, (category) => category.postsNamedTable)
|
||||
@ManyToMany(() => Category, (category) => category.postsNamedTable)
|
||||
@JoinTable()
|
||||
categoriesNamedTable: Promise<Category[]>
|
||||
|
||||
|
||||
@ -28,21 +28,21 @@ export class Category {
|
||||
@Column({ nullable: true })
|
||||
description: string
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categories)
|
||||
@ManyToMany(() => Post, (post) => post.categories)
|
||||
posts: Post[]
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categoriesWithOptions)
|
||||
@ManyToMany(() => Post, (post) => post.categoriesWithOptions)
|
||||
postsWithOptions: Post[]
|
||||
|
||||
@ManyToMany((type) => Post, (post) => post.categoriesWithNonPKColumns)
|
||||
@ManyToMany(() => Post, (post) => post.categoriesWithNonPKColumns)
|
||||
postsWithNonPKColumns: Post[]
|
||||
|
||||
@ManyToMany((type) => Tag, (tag) => tag.categories)
|
||||
@ManyToMany(() => Tag, (tag) => tag.categories)
|
||||
tags: Tag[]
|
||||
|
||||
@ManyToMany((type) => Tag, (tag) => tag.categoriesWithOptions)
|
||||
@ManyToMany(() => Tag, (tag) => tag.categoriesWithOptions)
|
||||
tagsWithOptions: Tag[]
|
||||
|
||||
@ManyToMany((type) => Tag, (tag) => tag.categoriesWithNonPKColumns)
|
||||
@ManyToMany(() => Tag, (tag) => tag.categoriesWithNonPKColumns)
|
||||
tagsWithNonPKColumns: Tag[]
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@ export class Post {
|
||||
@Column()
|
||||
title: string
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.posts)
|
||||
@ManyToMany(() => Category, (category) => category.posts)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.postsWithOptions)
|
||||
@ManyToMany(() => Category, (category) => category.postsWithOptions)
|
||||
@JoinTable({
|
||||
name: "post_categories",
|
||||
joinColumns: [
|
||||
@ -39,10 +39,7 @@ export class Post {
|
||||
})
|
||||
categoriesWithOptions: Category[]
|
||||
|
||||
@ManyToMany(
|
||||
(type) => Category,
|
||||
(category) => category.postsWithNonPKColumns,
|
||||
)
|
||||
@ManyToMany(() => Category, (category) => category.postsWithNonPKColumns)
|
||||
@JoinTable({
|
||||
name: "post_categories_non_primary",
|
||||
joinColumns: [
|
||||
|
||||
@ -20,11 +20,11 @@ export class Tag {
|
||||
})
|
||||
description: string
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.tags)
|
||||
@ManyToMany(() => Category, (category) => category.tags)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.tagsWithOptions)
|
||||
@ManyToMany(() => Category, (category) => category.tagsWithOptions)
|
||||
@JoinTable({
|
||||
name: "tag_categories",
|
||||
joinColumns: [
|
||||
@ -50,7 +50,7 @@ export class Tag {
|
||||
})
|
||||
categoriesWithOptions: Category[]
|
||||
|
||||
@ManyToMany((type) => Category, (category) => category.tagsWithNonPKColumns)
|
||||
@ManyToMany(() => Category, (category) => category.tagsWithNonPKColumns)
|
||||
@JoinTable({
|
||||
name: "tag_categories_non_primary",
|
||||
joinColumns: [
|
||||
|
||||
@ -16,7 +16,7 @@ export class Blog {
|
||||
@Column()
|
||||
text: string
|
||||
|
||||
@ManyToMany((type) => Category)
|
||||
@ManyToMany(() => Category)
|
||||
@JoinTable()
|
||||
categories: Category[]
|
||||
|
||||
|
||||
@ -562,7 +562,7 @@ describe("repository > basic methods", () => {
|
||||
await externalIdObjects.findBy({
|
||||
externalId: Like("external-bulk-%"),
|
||||
})
|
||||
).forEach((inserted, i) => {
|
||||
).forEach((inserted) => {
|
||||
inserted.title.should.be.equal("Initially inserted")
|
||||
})
|
||||
|
||||
@ -581,7 +581,7 @@ describe("repository > basic methods", () => {
|
||||
await externalIdObjects.findBy({
|
||||
externalId: Like("external-bulk-%"),
|
||||
})
|
||||
).forEach((updated, i) => {
|
||||
).forEach((updated) => {
|
||||
updated.title.should.be.equal("Updated")
|
||||
})
|
||||
}),
|
||||
|
||||
@ -16,6 +16,6 @@ export class UserWithEmbededEntity {
|
||||
@PrimaryColumn()
|
||||
id: number
|
||||
|
||||
@Column((type) => FriendStats)
|
||||
@Column(() => FriendStats)
|
||||
friend: FriendStats
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user