Skip to content

Support migrations files with ts file extension#915

Merged
sushantdhiman merged 1 commit into
sequelize:masterfrom
kroleg:migrations_with_ts_extension
Jul 5, 2020
Merged

Support migrations files with ts file extension#915
sushantdhiman merged 1 commit into
sequelize:masterfrom
kroleg:migrations_with_ts_extension

Conversation

@kroleg
Copy link
Copy Markdown
Contributor

@kroleg kroleg commented Jul 5, 2020

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Description of change

Support *.ts migration files

@sushantdhiman sushantdhiman merged commit f5fdf53 into sequelize:master Jul 5, 2020
@kroleg kroleg deleted the migrations_with_ts_extension branch July 5, 2020 05:54
@sushantdhiman
Copy link
Copy Markdown
Contributor

@intellix
Copy link
Copy Markdown

intellix commented Sep 10, 2020

I can't create feature requests without a test case but don't wanna lose the idea so writing here instead.

My current migrations are all JS and would like to transition them to TS migrations so I can import the interfaces to understand the methods available. They're being read but my migrations are starting from scratch and it seems to be because the migration name includes the extension:

20181113051813-create-achievement.js
20181113051813-create-achievement.ts

I can run an SQL to change the migrated extensions I guess:

UPDATE "SequelizeMeta" SET "name" = REPLACE("name", '.js', '.ts')

Would be cool if the migration name didn't include the extension (as an option) to allow users to move freely between extensions: js -> mjs -> cjs -> ts

@mirajehossain
Copy link
Copy Markdown

mirajehossain commented Jan 26, 2021

How do I generate migration in .ts extension?
Please update the doc and give an example to use this feature thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants