Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@forty-boy/sql-cli
Advanced tools
Readme
A CLI for the @forty-boy/sql library.
npm install @forty-boy/sql-cli
OR yarn add @forty-boy/sql-cli
If you want to get started using @forty-boy/sql and @forty-boy/sql-cli here are the necessary steps to take to get your project functioning properly.
./src
).env
file within that folder for your forty configurations
FORTY_HOST=<YOUR-DB-HOST>
FORTY_DB=<YOUR-DB-NAME>
FORTY_USER=<YOUR-DB-USERNAME>
FORTY_PASS=<YOUR-DB-PASSWORD>
FORTY_COMPILED_DIR=<YOUR-COMPILED-CODE-FOLDER>
./src
folder run your @forty-boy/sql-cli commands. Such as
forty-sql migration:add users
database
with two sub-folders; migrations
and schemas
.forty-sql migration:up
./src
directory. This is important for forty-sql to find the right files.@forty-boy/sql-cli navigates this file structure and it's not magic. The CLI must know where to go and where files live to function properly. The reason the FORTY_COMPILED_DIR
environment variable is so important is because the library needs to know where your migration files are to run them.
My Personal Structure:
lib // Javascript
├───database
│ ├───migration
│ └───schema
│
src // TypeScript
└───database
├───migration
└───schema
forty-sql migration:up
forty-sql migration:down
forty-sql migration:undo
forty-sql migration:redo
FORTY_COMPILED_DIR
flag to point to your compilation folder. This will tell forty-sql
where your migrations are. See Project setup section for more details.forty-sql migration:add <migration-name> [--add | -a]
forty-sql migration:add <migration-name> [--update | -u]
forty-sql migration:add <migration-name> [--remove | -r]
forty-sql migration:add <migration-name> <action> [--table | -t] <table-name>
forty-sql migration:add users
forty-sql schema:add users
forty-sql migration:add <migration-name>
./database/migrations
and ./database/schemas
if they do not already exists and add the corresponding files w/ boilerplate.forty-sql migration:add users
will create the following:
./database/migrations/<timestamp>_users.ts
./database/schemas/User.schema.ts
forty-sql migration:up
forty-sql migration:down
forty-sql migration:undo
forty-sql migration:red
forty-sql schema:add <schema-name>
./database/schemas
if it does not already exist and the corresponding file w/ boilerplate.forty-sql schema:add users
will create the following:
./database/schemas/User.schema.ts
forty-sql migration:add <migration-name> [--add | -a]
forty-sql migration:add <migration-name> [--update | -u]
forty-sql migration:add <migration-name> [--remove | -r]
forty-sql migration:add <migration-name> <action> [--table | -t] <table-name>
forty-sql migration:add AddFullNameColumn --add --table users
Create a remove
command for Migrations
down
method from the last created migration and remove it.Create a migration history table to track migrations similar to EF Core to prevent unwanted side-effects
FAQs
CLI for @forty-boy/sql
The npm package @forty-boy/sql-cli receives a total of 1 weekly downloads. As such, @forty-boy/sql-cli popularity was classified as not popular.
We found that @forty-boy/sql-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.