git clone https://github.com/webreca/laravel-reverse-migrator.git
cd laravel-reverse-migrator
composer install
4. Copy .env.example file to .env on the root folder. You can type copy .env.example .env if using command prompt Windows or cp .env.example .env if using terminal, Ubuntu
copy .env.example .env
5. Open your .env file and change the database name (DB_DATABASE) to whatever you have, username (DB_USERNAME) and password (DB_PASSWORD) field correspond to your configuration.
php artisan key:generate
php artisan migrate
php artisan serve
To create migrations for all the tables, run:
php artisan migrate:generate
You can specify the tables you wish to generate using:
php artisan migrate:generate --tables="table1,table2,table3,table4,table5"
You can also ignore tables with:
php artisan migrate:generate --ignore="table3,table4,table5"
Laravel Migrations Generator will first generate all the tables, columns and indexes, and afterwards setup all the foreign key constraints.
So make sure you include all the tables listed in the foreign keys so that they are present when the foreign keys are created.
You can also specify the connection name if you are not using your default connection with:
php artisan migrate:generate --connection="connection_name"
By default, Generator will generate multiple migration files for each table.
You can squash all migrations into a single file with:
php artisan migrate:generate --squash
Run php artisan help migrate:generate
for a list of options.
Options | Description |
---|---|
-c, --connection[=CONNECTION] | The database connection to use |
-t, --tables[=TABLES] | A list of tables or views you wish to generate migrations for separated by a comma: users,posts,comments |
-i, --ignore[=IGNORE] | A list of tables or views you wish to ignore, separated by a comma: users,posts,comments |
-p, --path[=PATH] | Where should the file be created? |
-tp, --template-path[=TEMPLATE-PATH] | The location of the template for this generator |
--date[=DATE] | Migrations will be created with specified date. Views and foreign keys will be created with + 1 second. Date should be in format supported by Carbon::parse |
--table-filename[=TABLE-FILENAME] | Define table migration filename, default pattern: [datetime]\_create_[name]_table.php |
--view-filename[=VIEW-FILENAME] | Define view migration filename, default pattern: [datetime]\_create_[name]_view.php |
--proc-filename[=PROC-FILENAME] | Define stored procedure filename, default pattern: [datetime]\_create_[name]_proc.php |
--fk-filename[=FK-FILENAME] | Define foreign key migration filename, default pattern: [datetime]\_add_foreign_keys_to_[name]_table.php |
--log-with-batch[=LOG-WITH-BATCH] | Log migrations with given batch number. We recommend using batch number 0 so that it becomes the first migration |
--default-index-names | Don't use DB index names for migrations |
--default-fk-names | Don't use DB foreign key names for migrations |
--use-db-collation | Generate migrations with existing DB collation |
--skip-log | Don't log into migrations table |
--skip-vendor | Don't generate vendor migrations |
--skip-views | Don't generate views |
--skip-proc | Don't generate stored procedures |
--squash | Generate all migrations into a single file |
--with-has-table | Check for the existence of a table using hasTable |
The generator first generates all tables and then adds foreign keys to existing tables.
However, SQLite only supports foreign keys upon creation of the table and not when tables are altered. add_foreign_keys migrations will still be generated, however will get omitted if migrate to SQLite type database.
The generator will recognize user-defined type from the schema, and then generate migration as
public function up()
{
Schema::create('table', function (Blueprint $table) {
...
});
DB::statement("ALTER TABLE table ADD column custom_type NOT NULL");
}
Note that the new column
is always added at the end of the created table
which means the ordering of the column generated in migration will differ from what we have from the schema.
Supported database with user-defined types:
- PostgreSQL
- SQL Server
Mandatory parameter which defines which table/s will be used for seed creation. Use CSV notation for multiple tables. Seed file will be generated for each table.
Examples:
php artisan iseed my_table
php artisan iseed my_table,another_table
Welcome to Webreca Technologies! We specialize in delivering top-notch, innovative web solutions to clients across the globe. Based in the heart of New Delhi, India, we are dedicated to providing cutting-edge technologies and creative digital solutions tailored to meet your unique business needs.
We are a dynamic web development agency based in New Delhi, offering comprehensive services in web design, development, and digital marketing. With a team of highly skilled professionals, we are passionate about creating websites that not only look great but also deliver exceptional user experiences and functionality.
Our mission is to empower businesses of all sizes to establish a strong online presence, improve engagement, and achieve their digital goals through high-performance web solutions.
We offer a wide range of services to help your business grow in the digital landscape:
- Build responsive, user-friendly websites tailored to your needs.
- Expertise in HTML, CSS, JavaScript, React, Angular, Vue.js, and more.
- CMS development (WordPress, Joomla, Drupal).
- Development of secure and scalable online stores.
- Integration with payment gateways (PayPal, Stripe, Razorpay, etc.).
- Platforms: Shopify, WooCommerce, Magento, BigCommerce.
- Intuitive and visually appealing web designs.
- User-centric designs that improve user engagement.
- Wireframes, prototypes, and mockups using tools like Figma and Adobe XD.
- Improve your website’s search engine ranking with our SEO services.
- Social media management, PPC campaigns, email marketing.
- Brand strategy and online reputation management.
- Cross-platform mobile apps for Android and iOS.
- Native apps, progressive web apps (PWAs), and hybrid solutions.
- Regular updates, backups, and security patches.
- Ongoing support and troubleshooting.
- Performance optimization for speed and scalability.
-
Experienced Team: Our team consists of experienced developers, designers, and marketers who are passionate about bringing your ideas to life.
-
Tailored Solutions: We believe that every business is unique. We provide customized solutions that align with your business goals and target audience.
-
Cutting-edge Technology: We stay ahead of the curve by adopting the latest technologies and industry best practices to ensure your project is built for the future.
-
Client-Centric Approach: We value communication and transparency throughout the development process. Your satisfaction is our priority.
-
Competitive Pricing: We offer high-quality solutions at competitive prices, making us the perfect choice for businesses of all sizes.
-
Timely Delivery: We understand the importance of deadlines and ensure that projects are completed on time, without compromising quality.
- Discovery & Planning: Understanding your requirements, goals, and target audience.
- Design & Prototyping: Creating wireframes, mockups, and prototypes to define the visual direction.
- Development: Building the website or application with the latest technologies.
- Quality Assurance: Testing across devices and browsers to ensure functionality and performance.
- Launch & Maintenance: Deploying the project and providing ongoing support and updates.
We work with a variety of technologies to create high-performance websites and applications:
- Frontend: HTML5, CSS3, JavaScript, React, Angular, Vue.js
- Backend: Node.js, Python (Django, Flask), PHP, Ruby on Rails
- Databases: MySQL, MongoDB, PostgreSQL
- CMS: WordPress, Joomla, Drupal
- E-commerce: Shopify, WooCommerce, Magento, OpenCart
- Mobile Apps: React Native, Flutter, Swift, Kotlin
We have worked with businesses of all sizes, from startups to large enterprises. Our diverse portfolio spans various industries, including e-commerce, healthcare, education, finance, and more.
Are you ready to build your digital presence? Let’s talk!
- 📧 Email: webreca@gmail.com
- ☎️ Phone: +91-9999577620
- 📍 Office Address: M-4, New Police Line, Kingsway Camp, New Delhi, India 110009
Follow us on social media for the latest updates:
We’re always looking for talented developers, designers, and marketers to join our growing team. If you're passionate about web development and want to work in a collaborative, innovative environment, check out our careers page for open positions.
This project is licensed under the MIT License.
We’d like to acknowledge our talented team, our loyal clients, and the technologies that empower us to deliver excellent digital experiences.
Thank you for considering us for your next project! We look forward to partnering with you.