Skip to content

Commit

Permalink
Merge pull request #169 from ProjectXero/fix/gh-168
Browse files Browse the repository at this point in the history
fix: order columns alphabetically
  • Loading branch information
rintaun authored Mar 17, 2021
2 parents 6cffc8f + 6ce8880 commit a522cbd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/generator/__tests__/__snapshots__/integration.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,43 @@ export const TestTableOrder$Types: Record<keyof TestTableOrder, string> = {
subsequent_table_type: \\"test_table_standard\\"
};
export interface TestTableStandard<TJsonbTest = SerializableValueType> {
id: number;
arr_test: string[] | null;
domain_test: string | null;
enum_test: TestTypeEnum;
enum_arr_test: TestTypeEnum[] | null;
enum_test: TestTypeEnum;
id: number;
jsonb_test: MapToSerializable<TJsonbTest> | null;
}
export interface TestTableStandard$Insert<TJsonbTest = SerializableValueType> {
id?: number;
arr_test?: string[] | null;
domain_test?: string | null;
enum_test: TestTypeEnum;
enum_arr_test?: TestTypeEnum[] | null;
enum_test: TestTypeEnum;
id?: number;
jsonb_test?: MapToSerializable<TJsonbTest> | null;
}
export const TestTableStandard$Types: Record<keyof TestTableStandard, string> = {
id: \\"int4\\",
arr_test: \\"text\\",
domain_test: \\"text\\",
enum_test: \\"test_type_enum\\",
enum_arr_test: \\"test_type_enum\\",
enum_test: \\"test_type_enum\\",
id: \\"int4\\",
jsonb_test: \\"jsonb\\"
};
export interface TestTableTypes {
id: string;
table_test: TestTableStandard | null;
table_arr_test: TestTableStandard[];
table_test: TestTableStandard | null;
}
export interface TestTableTypes$Insert {
id: string;
table_test?: TestTableStandard | null;
table_arr_test?: TestTableStandard[];
table_test?: TestTableStandard | null;
}
export const TestTableTypes$Types: Record<keyof TestTableTypes, string> = {
id: \\"uuid\\",
table_test: \\"test_table_standard\\",
table_arr_test: \\"test_table_standard\\"
table_arr_test: \\"test_table_standard\\",
table_test: \\"test_table_standard\\"
};
"
`;
2 changes: 1 addition & 1 deletion src/generator/database/SchemaInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class SchemaInfo {
c.table_schema = ${this.name} AND
c.table_name = ${table}
)
ORDER BY c.ordinal_position
ORDER BY c.column_name
`
}

Expand Down

0 comments on commit a522cbd

Please sign in to comment.