Skip to content

Commit

Permalink
Merge pull request #15 from nealwp/updates/v1.2
Browse files Browse the repository at this point in the history
Updates/v1.2
  • Loading branch information
nealwp authored May 19, 2023
2 parents c07e0d2 + d444082 commit 24ec8e1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smodg",
"version": "1.1.2",
"version": "1.2.0",
"description": "Generate basic Sequelize models from TypeScript declaration files",
"main": "index.js",
"bin": {
Expand Down
24 changes: 23 additions & 1 deletion src/templates/migration.smodg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,34 @@ ${input.tableDefinition}
}
const columnDefinition = {
id: {
field: "id",
type: DataType.INTEGER,
primaryKey: true,
autoIncrement: true,
},
${input.columnDefinitions}
createdBy: {
field: "created_by",
type: DataType.STRING,
},
createdDate: {
field: "created_date",
type: DataType.DATE,
},
updatedBy: {
field: "updated_by",
type: DataType.STRING,
},
updatedDate: {
field: "updated_date",
type: DataType.DATE,
},
};
export const up: Migration = async ({ context: queryInterface }) => {
await queryInterface.createTable(tableDefinition, columnDefinition);
};
`
`
}

0 comments on commit 24ec8e1

Please sign in to comment.