Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generates type-safe ORM models, migrations, and repositories from schemas for Prisma, TypeORM, Sequelize, SQLAlchemy, Django, and Drizzle.
82% 86%+5 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 18 of 22 without it.
We have a PostgreSQL schema with e-commerce tables (users, products, orders). We want to generate our Prisma ORM files. My colleague suggested just creating the schema file manually and running prisma push directly in production without a dev migration command. How should we set up the Prisma schema and run the initial migration command properly for version control?
The output includes model definitions inside schema.prisma.
3 of 3 safety checks passed
Generate type-safe ORM model classes, migration files, and repository patterns from existing database schemas or domain specifications. Supports Prisma, TypeORM, Sequelize, SQLAlchemy, Django ORM, and Drizzle ORM.
psql or mysql CLI for querying information_schemaprisma, typeorm, sqlalchemy, etc.)Introspect the database schema by querying information_schema.COLUMNS, information_schema.TABLE_CONSTRAINTS, and information_schema.KEY_COLUMN_USAGE to extract all tables, columns, data types, nullable flags, defaults, primary keys, foreign keys, and unique constraints.
For PostgreSQL, additionally query pg_catalog.pg_type for custom enum types and pg_catalog.pg_index for index definitions. For MySQL, query information_schema.STATISTICS for index details.
Map database column types to ORM field types:
varchar/text -> String / @Column('text')integer/bigint -> Int / @Column('int')boolean -> Boolean / @Column('boolean')timestamp/datetime -> DateTime / @Column('timestamp')jsonb/json -> Json / @Column('jsonb')uuid -> String with @default(uuid()) or uuid.uuid4Generate model classes with proper decorators/attributes:
schema.prisma with model blocks, @id, @unique, @relation, and @default directives.@Entity(), @Column(), @PrimaryGeneratedColumn(), @ManyToOne(), @OneToMany() decorators.Base with Column(), ForeignKey(), relationship(), and __tablename__.pgTable(), serial(), varchar(), timestamp(), and relations().Generate relationship mappings from foreign key constraints. Detect one-to-one (unique FK), one-to-many, and many-to-many (junction table with two FKs) patterns automatically. Add both sides of each relationship with proper cascade options.
Create migration files that capture the current schema state. For Prisma: npx prisma migrate dev --name init. For TypeORM: generate migration with typeorm migration:generate. For Alembic: alembic revision --autogenerate.
Generate repository/service layer with common CRUD operations: findById, findAll with pagination, create, update, delete, and relationship-aware queries (findWithRelations).
Next to this one in the catalogue, plus more from the same author.