Registry / devops / sails-generate-model-with-migrations

sails-generate-model-with-migrations

JSON →
library1.0.0jsnpmunverified

A Sails.js generator that creates both a model and a database migration for your Sails app. This package is deprecated as it targets Sails v0.9/v0.10 and relies on the now-removed built-in migrations; for current Sails versions (v1.0+), use the sails-hook-orm or manual migration tools instead. The generator is installed via npm and invoked with 'sails generate model'.

npm install sails-generate-model-with-migrations
INSTALL
IMPORT
SIG · SAILS-GENERATE-MOD
S
sails-generate-model-with-migrations
devopsjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default generator
sails generate model
require('sails-generate-model-with-migrations')
This package is a Sails generator, not a programmatic module. Use the Sails CLI to invoke it.

Installs the generator and uses the Sails CLI to generate a model and migration for a 'User' entity.

npm install sails-generate-model-with-migrations # Then inside a Sails app: sails generate model user --attributes name:string,email:string
Debug
Known issues
deprecatedThis package is not compatible with Sails v1.0+ as built-in migrations have been removed.
fix
Use sails-hook-orm with Knex.js or other migration libraries.
affects: >=1.0.0
gotchaThe generator only works when called via the Sails CLI inside a valid Sails app directory.
fix
Ensure you run 'sails generate model' from the root of a Sails app.
affects: >=0.0.0
gotchaGenerated migration files use an old format that may not be compatible with modern database adapters.
fix
Manually update migrations to use Knex or other migration syntax.
affects: >=0.0.0
Errors
Common errors & fixes
Error: `sails-generate-model-with-migrations` is not a valid generator.
The generator is not installed or not found by Sails' generator lookup.
fix
Run 'npm install sails-generate-model-with-migrations' in your Sails app directory.
TypeError: Cannot read property 'attributes' of undefined
The generator expects certain Sails version conventions that may have changed.
fix
Check your Sails version and ensure compatibility; use a different generator for newer Sails.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
sailsrequiredRequires Sails.js framework to run; the generator hooks into Sails' generator system.
Agent activity
8 hits · last 30 days
node
8
Resources
sails-generate-model-with-migrations — npm install sails-generate-model-with-migrations · libregistry