Skip to content

Commit

Permalink
test: prefix subcounters sub-entity with "sub" to fit in 30 character…
Browse files Browse the repository at this point in the history
… identifier for oracle

Problem introduced with #6981
  • Loading branch information
nebkat committed Feb 26, 2021
1 parent 0bf97ab commit 0bb2a40
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test/functional/entity-metadata/entity/Counters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class Counters {
@Column()
favorites: number;

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

@ManyToMany(type => User, user => user.likedPosts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Counters {
@Column()
favorites: number;

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Counters {
@JoinTable({ name: "counter_categories" })
categories: Category[];

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcntrs: Subcounters;

categoryIds: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Counters {
@ManyToOne(type => Category)
category: Category;

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

categoryId: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Counters {
@ManyToOne(type => Category, category => category.posts)
category: Category;

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

categoryId: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Counters {
@OneToMany(type => Category, category => category.post)
categories: Category[];

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

categoryIds: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Counters {
@OneToMany(type => Category, category => category.posts)
categories: Category[];

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

categoryIds: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Counters {
@JoinColumn()
category: Category;

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

categoryId: number[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class Counters {
@JoinColumn()
category: Category;

@Column(() => Subcounters)
@Column(() => Subcounters, {prefix: "sub"})
subcounters: Subcounters;

categoryId: number;
Expand Down
6 changes: 2 additions & 4 deletions test/github-issues/6977/issue-6977.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import { expect } from "chai";
import { Embedded } from "./entity/Embedded";
import { User } from "./entity/User";

describe("github issues > #6977 Relation columns in embedded entities are not prefixed", () => {
describe.only("github issues > #6977 Relation columns in embedded entities are not prefixed", () => {

let connections: Connection[];
before(async () => connections = await createTestingConnections({
entities: [User, Embedded],
enabledDrivers: ["mysql"],
enableNextFeatures: true // TODO: NEXT 0.3.0 default to fixed embedded columns
entities: [User, Embedded]
}));
beforeEach(() => reloadTestingDatabases(connections));
after(() => closeTestingConnections(connections));
Expand Down

0 comments on commit 0bb2a40

Please sign in to comment.