Skip to content

Support migrations files with ts file extension #915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2020
Merged

Support migrations files with ts file extension #915

merged 1 commit into from
Jul 5, 2020

Conversation

kroleg
Copy link
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
Contributor

@intellix
Copy link

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

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