npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jdpnielsen/sequelize-cli-typescript

v6.3.0

Published

The Sequelize CLI (TypeScript)

Downloads

11

Readme

Fork

This repository was forked to allow having a compiled folder for migrations and seeders.

By setting up local scripts you are able to compile .ts -> .js migrations within your Sequelize's configuration folders and run them as usual.

I have extended this functionallity to allow migrating typescript in runtime - meaning you are not required to compile .ts down to .js anymore. Run your migrations as usual.

Be sure that your Sequelize compiled path for migrations and seeders point to a correct location.

The Sequelize Command Line Interface (CLI) for TypeScript

Table of Contents

Installation

Globally

Install CLI globally with

$ npm install -g @jdpnielsen/sequelize-cli-typescript

Now you can run CLI using following command anywhere

sequelize-ts

Locally

Install CLI locally to your node_modules folder with

$ npm install --save @jdpnielsen/sequelize-cli-typescript

You should be able to run CLI with

$ node_modules/.bin/sequelize-ts

Usage

Sequelize CLI [Node: 10.21.0, CLI: 6.0.0, ORM: 6.1.0]

### Differences from Sequelize-Cli _(non-TypeScript)_

With sequelize-cli, the ```model:generate``` command would produce _JavaScript_ files in two folders: 
/models and /migrations, or other folders as specified in your .sequelizerc file.  The ```db:migrate``` 
command would then exe ute these _JavaScript_ files to update your database.

With sequelize-cli-typescript, ```model:generate``` produces _TypeScript_ files in the same two folders
(or again, as specified in your .sequelizerc file).  But before you can run ```db:migrate``` you must
compile your migrations.  (The step of compiling your migrations is left to you.)

You could compile your migrations along with your other code, or as part of a separate script.  After you have compiled
your migrations, then you can run ```db:migrate```.

It's usually the case that the compiled _JavaScript_ code will be put in a different directory than
the source _TypeScript_ code, so whereas sequelize-cli had one ```migrations-path``` setting, 
sequelize-cli-typescript has two: ```migrations-source-path``` and ```migrations-compiled-path```, which
default to /migrations and /migrations/compiled respectively.


### Usage

Sequelize CLI [Node: 6.11.2, CLI: 3.0.0, ORM: 4.8.0]

Commands: sequelize-ts db:migrate Run pending migrations sequelize-ts db:migrate:schema:timestamps:add Update migration table to have timestamps sequelize-ts db:migrate:status List the status of all migrations sequelize-ts db:migrate:undo Reverts a migration sequelize-ts db:migrate:undo:all Revert all migrations ran sequelize-ts db:seed Run specified seeder sequelize-ts db:seed:undo Deletes data from the database sequelize-ts db:seed:all Run every seeder sequelize-ts db:seed:undo:all Deletes data from the database sequelize-ts db:create Create database specified by configuration sequelize-ts db:drop Drop database specified by configuration sequelize-ts init Initializes project sequelize-ts init:config Initializes configuration sequelize-ts init:migrations Initializes migrations sequelize-ts init:models Initializes models sequelize-ts init:seeders Initializes seeders sequelize-ts migration:generate Generates a new migration file [aliases: migration:create] sequelize-ts model:generate Generates a model and its migration [aliases: model:create] sequelize-ts seed:generate Generates a new seed file [aliases: seed:create]

Options: --version Show version number [boolean] --help Show help [boolean]

Please specify a command


## Contributing

All contributions are accepted as a PR.

- You can file issues by submitting a PR (with test) as a test case.
- Implement new feature by submitting a PR
- Improve documentation by submitting PR to [Sequelize](https://github.com/sequelize/sequelize)

Please read the [contributing guidelines](CONTRIBUTING.md).

## Documentation

- [Migrations Documentation](https://sequelize.org/master/manual/migrations.html)
- [CLI Options](docs/README.md)
- [Frequently Asked Questions](docs/FAQ.md)