CodeIgniter : 3.0 database migration through composer - php

Iam working on CodeIgniter database Migrations.
I create table using Migrate.php controller in my project and it's work fine.
Question is it possible to migrate database using cmd like laravel database Migrations?.

Yes.
You can do it with php index.php tools
Most frameworks have built-in command lines and almost all users of these frameworks have to interact with the command line. CodeIgniter has the base for the command line interface but it’s not implemented by default.
Go through with this tutorial CodeIgniter Migration - tutorials.kode-blog.com

Related

deploy web application with laravels voyager admin panel

i developed a Website using Laravel 5.5 and Voyager Admin panel.
Now i want to deploy my website to a DigitalOcean server.
While developing I created tables via Voyagers Database Tool.
I also set my relations between the tables there. This worked very well in my developing environment.
I pushed my final code of the website to a git repo and now i want to clone it on the liveserver.
Now my question:
Do I have do recreate all tables again via the voyager admin panel and set the relations between the tables new again? Because i didn't create migrations for the tables and only created tables through the voyager backend.Or will they automatically be set if i clone the repo and make an php artisan voyager:install or an php artisan migrate?
Would be nice if anybody already gained some experience with deploying voyager applications.
Best regards
If you still didn't find any solution, you can try: Laravel Migrations Generator.
It will automatically generate migrations from an existing database schema.
Then you can do:
php artisan migrate
Hope, it will solve your problem.

Laravel migration deployment

Just a quick one really
I have an existing Laravel app
I want to use a migration to add some columns to an existing table
So i do the following:
php artisan make:migration add_columns_to_table
Which creates a file in my migrations folder called:
2017_10_25_124938_add_column_to_table.php
And also creates an entry in my migrations table in the database. All good.
I can edit the migration file (adding the columns etc) and run
php artisan migrate
And everything works great
Now - my question is this:
When i come to deploy to live i am presuming I would log onto the live box and run the create migration command again:
php artisan make:migration add_columns_to_table
But this will create a migration with a different name to the one i created / tested locally?
So - do i then need to manually copy the code from my local 2017_10_25_124938_add_column_to_table.php migration file to the one created on the live box?
That seems a bit backwards and fiddly
What is the best way of creating and testing a migration locally and then deploying it to live when the create migration command creates a different named migration file (and DB entry) on the live box?
Or have i got the wrong end of the stick?
The best practice is to keep migration files with the repo. While deploying the application on any environment you have to execute all migrations.
php artisan migrate
This command will run all the migrations which are not already executed in the current environment. Laravel use a table called 'migrations' to keep track of all the migrations it has run.

Using Illuminate Database outside Laravel without PHP Artisan Commands

I'm trying to set up database migrations using Illuminate's Database outside of a Laravel 4.2 project. Everything I'm reading online indicated that it is completely doable to use any Illuminate components outside of Laravel, but the difficulty I'm having is creating the database migrations without using Artisan commands ("php artisan make:migration create_user_table"). If any one could help me out with this, I'd really appreciate it, because I know someone has had to find a solution to the problem before.
Thanks!
If you want to use artisan commands you should include the package of it and configure your application accordingly.
illuminate\database package doesn't provide you and artisan commands to use.

PHP script MYSQL database to migration in laravel 5.1

I have MYSQL database.
How can i convert database to migration on laravel 5.1
Any body have script?
In order to generate migration files based on existing database structure you can use one of available Laravel packages. I've used Xethron/migrations-generator in one of my projects - you can find it here: https://github.com/Xethron/migrations-generator.
There are some small issues running it with Laravel 5.1, but they are easy to solve - you can check the discussion here: https://laracasts.com/discuss/channels/general-discussion/laravel-5-migrations-from-existing-database?page=1 - one entry needs to be added to your composer.json.
Once you have the package properly installed and configured, make sure you have correct database credentials in your database.php config file and then run php artisan migrate:generate and migration files will be generated.

How to run any existing CodeIgniter project on Xampp?

I am new to CodeIgniter. Kindly tell me how to run any existing project developed using CodeIgniter on Xampp. It has no database. How can I create database for this project?
how to run: open index file in browser or cli.
how to create database- well if you don't have dump, then you are out of luck and only option is to investigate queries and try to replicate tables.

Categories