nwidart / dbexporter Goto Github PK
View Code? Open in Web Editor NEWExport your database as a Laravel Migration. And export your DB data as a seed file. Finally sync all this with your remote server.
Export your database as a Laravel Migration. And export your DB data as a seed file. Finally sync all this with your remote server.
nwidart\db-exporter\src\Nwidart\DbExporter\DbExporter.php
文件:37行
'information_schema.columns' 修正为 DB::raw('information_schema.columns')
原因:DB::table('information_schema.columns') 会自动加上前缀,导致报错
例:SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bool_bool_inform
ation_schema.columns' doesn't exist (SQL: select column_name
as Field
,
column_type
as Type
, is_nullable
as Null
, column_key
as Key
, c olumn_default
as Default
, extra
as Extra
, data_type
as Data_Type
from bool_bool_information_schema
.columns
where table_schema
= bool_
cms and table_name
= bool_admins)
May I know if this works for MS Sql?
I like your package a lot, but a question; can the illuminate/support required dependency set to 4.0? I have some projects I wanna upgrade to L4.1, and doing it with a seed from the current database would be great!
The database is not recognized if used with prefix (specified in config/database.php).
I get the following error message:
[PDOException]
SQLSTATE[42703]: Undefined column: 7 ERROR: column "table" does not ex
ist
the database is working perfectly
After adding 'Nwidart\DbExporter\DbExportHandlerServiceProvider' to the 'providers' array in config/app.php, any call to php artisan [any existing command] returns ' [BadMethodCallException] Call to undefined method [package]'
If the reference to the ServiceProvider is removed, artisan functions as expected.
Installation guide has been followed to the letter although I am running Laravel 5.1. Had to use dev-master as 1.0 would not install.
If I comment out $this->package('nwidart/db-exporter'); from the boot() method in #27 of DbExportHandlerServiceProvider.php, artisan is functional but •php artisan dbe:seeds• throws PHP Fatal error: Class 'Str' not found in /base/myapp/vendor/nwidart/db-exporter/src/Nwidart/DbExporter/DbSeeding.php on line 112
Obviously happy to provide any further details that would help.
Hi!
I can't use your the package correctly after install the dev-master version via composer. I always get this error if I try to use it directly or if I try to do your "publish" command ("php artisan config:publish nwidart/db-exporter"):
[BadMethodCallException]
Call to undefined method [package]
Any idea to help me?
Thanks
The library does not support PostgreSQL
Hi,
e.q.
If there is a column name data and the type is longblob then you would espect this: $table->binary('data');
But you get instead this: $table->('data');
So the type longblob it is not recognized.
MangaC
Hi,
First of all, thanks for this really nice package ! It really helps me.
It works well but for me it lacks a good feature: Be able to export relationships between tables (References index).
I have a 40+ tables DB and I'll need to edit the migration manually to add all those relationships.
Primary keys don't seem to be read in at all.
Furthermore, tables with multiple (integer) primary keys seem to turn into two 'increments' fields rather than two integers and $table->primary('A', 'B'). Ignoring primary keys is "acceptable", but incorrectly marking fields 'incrementing' when they are not may cause unintended consequences :(
Thanks for all the work so far -- I decided to choose yours over a different solution due to the active development.
Is this project abandoned?
In favor of any other not mentioned?
Not competible with laravel5, getting error in service provider. "$this->package('nwidart/db-exporter');"
package is not a method.
Just started using this package, and love the idea and usefulness of it already. So thought I would highlight a problem when using an unsigned decimal field.
I got the following broken php line in the generated migration file.
$table->decimal('price', 8,2) unsigne)->unsigned();
When using seed generator, table without any data are being seeded even if they have no data:
DB::table('my_table')->insert(array());
producing an error when launching the seed:
Illuminate\Database\Query\Builder::insert() must be of the type array, none given
At the moment it is overwriting the previous seed when I do return DbExportHandler::seed();
, is there a way to add a timestamp in it like the migrations have?
DbExportHandler::ignore(["table_1","table_2"])->seed();
Results in an empty seed file:
class liveTableSeeder extends Seeder {
public function run()
{
}
}
Problem 1
- Installation request for nwidart/db-exporter ^1.0 -> satisfiable by nwidart/db-exporter[1.0].
- Conclusion: remove laravel/framework v5.1.8
- Conclusion: don't install laravel/framework v5.1.8
- nwidart/db-exporter 1.0 requires illuminate/support ~4 -> satisfiable by illuminate/support[v4.0.0, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13,
If the database has JSON data (saved in String format) the importer writes back wrong data onto the server. (After db:seed and then running migrate:refresh --seed)
I could not use it directly in laravel 5.1 because of:
public function boot()
{
$this->package('nwidart/db-exporter');
}
To fix it, i overriden these classes in my app:
DbExportHandlerServiceProvider
DbMigrationsServiceProvider
to have the boot() method empty
(no call to ->package which does not exists)
Please? :)
Problem 1
- nwidart/db-exporter 0.5 requires illuminate/support 4.1.x -> satisfiable by laravel/framework[4.1.x-dev], illuminate/support[4.1.x-dev, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13, v4.1.14, v4.1.15, v4.1.16, v4.1.17, v4.1.18, v4.1.19, v4.1.2, v4.1.20, v4.1.21, v4.1.22, v4.1.23, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9].
- nwidart/db-exporter 0.5 requires illuminate/support 4.1.x -> satisfiable by laravel/framework[4.1.x-dev], illuminate/support[4.1.x-dev, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13, v4.1.14, v4.1.15, v4.1.16, v4.1.17, v4.1.18, v4.1.19, v4.1.2, v4.1.20, v4.1.21, v4.1.22, v4.1.23, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9].
- don't install illuminate/support 4.1.x-dev|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.0|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.1|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.10|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.11|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.12|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.13|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.14|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.15|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.16|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.17|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.18|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.19|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.2|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.20|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.21|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.22|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.23|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.3|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.4|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.5|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.6|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.7|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.8|don't install laravel/framework 4.2.x-dev
- don't install illuminate/support v4.1.9|don't install laravel/framework 4.2.x-dev
- Can only install one of: laravel/framework[4.2.x-dev, 4.1.x-dev].
- Can only install one of: laravel/framework[4.2.x-dev, 4.1.x-dev].
- Installation request for laravel/framework 4.2.* -> satisfiable by laravel/framework[4.2.x-dev].
- Installation request for nwidart/db-exporter 0.5 -> satisfiable by nwidart/db-exporter[0.5].
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Illuminate\Foundation\Application::share()
Null data are exported as empty string ('') instead of NULL.
This conflicts when we try to import it back especially to the field that has is not string (datetime, etc).
Considering that the actual version is not supporting full exporting, it would be a good improvement to support all the Schema Builder features (http://laravel.com/docs/schema) like indexes, unique keys, foreign keys, engine.
Foreign keys, indexes, and others are fully required in order to keep the db integrity, also optimized.
Class 'Str' not found in src/Nwidart/DbExporter/DbMigrations.php#L217
fix:full namespace use
use Illuminate\Support\Str;
It'd be nice
For example:
class myprojectTableSeeder extends Seeder {
public function run()
{
DB::table('assigned_roles')->insert(
);DB::table('password_reminders')->insert(
);DB::table('permission_role')->insert(
);DB::table('permissions')->insert(
);
DB::table('roles')->insert(array(
array(
'id' => 1,
'name' => 'Admin',
'created_at' => '2014-08-11 11:00:00',
'updated_at' => '2014-08-11 11:00:00',
),
array(
'id' => 2,
'name' => 'User',
'created_at' => '2014-08-11 11:00:00',
'updated_at' => '2014-08-11 11:00:00',
),
));DB::table('users')->insert(
);
}
}
Won't work as this error will appeared:
[ErrorException] Argument 1 passed to Illuminate\Database\Query\Builder::insert() must be of the type array, none given, called in D:\Projects\myprojectTableSeeder.php on line 8 and defined
Please fix it, maybe just remove the line entirely when the table is empty.
During the import of the data there are concerns of quotation marks.
array( 't_nom_rue' => 'Rue d'Enhaive 133',)
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove laravel/framework v5.0.32
- Conclusion: don't install laravel/framework v5.0.32
- Conclusion: don't install laravel/framework v5.0.31
- Conclusion: don't install laravel/framework 5.0.30
- Conclusion: don't install laravel/framework v5.0.29
- Conclusion: don't install laravel/framework v5.0.28
- Conclusion: don't install laravel/framework v5.0.27
- Conclusion: don't install laravel/framework v5.0.26
- Conclusion: don't install laravel/framework v5.0.25
- Conclusion: don't install laravel/framework v5.0.24
- Conclusion: don't install laravel/framework v5.0.23
- Conclusion: don't install laravel/framework v5.0.22
- Conclusion: don't install laravel/framework v5.0.21
- Conclusion: don't install laravel/framework v5.0.20
- Conclusion: don't install laravel/framework v5.0.19
- Conclusion: don't install laravel/framework v5.0.18
- Conclusion: don't install laravel/framework v5.0.17
- Conclusion: don't install laravel/framework v5.0.16
- Conclusion: don't install laravel/framework v5.0.15
- Conclusion: don't install laravel/framework v5.0.14
- Conclusion: don't install laravel/framework v5.0.13
- Conclusion: don't install laravel/framework v5.0.12
- Conclusion: don't install laravel/framework v5.0.11
- Conclusion: don't install laravel/framework v5.0.10
- Conclusion: don't install laravel/framework v5.0.9
- Conclusion: don't install laravel/framework v5.0.8
- Conclusion: don't install laravel/framework v5.0.7
- Conclusion: don't install laravel/framework v5.0.6
- Conclusion: don't install laravel/framework v5.0.5
- Conclusion: don't install laravel/framework v5.0.4
- Conclusion: don't install laravel/framework v5.0.3
- Installation request for nwidart/db-exporter 1.0 -> satisfiable by nwidart
/db-exporter[1.0].
- Conclusion: don't install laravel/framework v5.0.2
- Conclusion: don't install laravel/framework v5.0.1
- nwidart/db-exporter 1.0 requires illuminate/support ~4 -> satisfiable by i
lluminate/support[v4.0.0, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.
6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13, v
4.1.14, v4.1.15, v4.1.16, v4.1.17, v4.1.18, v4.1.19, v4.1.2, v4.1.20, v4.1.21, v
4.1.22, v4.1.23, v4.1.24, v4.1.25, v4.1.26, v4.1.27, v4.1.28, v4.1.29, v4.1.3, v
4.1.30, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.1, v4.2.12, v4.2.16
, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
- don't install illuminate/support v4.0.0|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.1|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.10|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.0.2|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.3|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.4|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.5|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.6|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.7|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.8|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.0.9|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.0|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.1|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.10|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.11|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.12|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.13|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.14|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.15|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.16|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.17|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.18|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.19|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.2|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.20|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.21|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.22|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.23|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.24|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.25|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.26|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.27|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.28|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.29|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.3|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.30|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.1.4|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.5|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.6|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.7|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.8|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.1.9|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.1|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.12|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.2.16|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.2.17|don't install laravel/framework v
5.0.0
- don't install illuminate/support v4.2.2|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.3|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.4|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.5|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.6|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.7|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.8|don't install laravel/framework v5
.0.0
- don't install illuminate/support v4.2.9|don't install laravel/framework v5
.0.0
- Installation request for laravel/framework 5.0.* -> satisfiable by laravel
/framework[5.0.30, v5.0.0, v5.0.1, v5.0.10, v5.0.11, v5.0.12, v5.0.13, v5.0.14,
v5.0.15, v5.0.16, v5.0.17, v5.0.18, v5.0.19, v5.0.2, v5.0.20, v5.0.21, v5.0.22,
v5.0.23, v5.0.24, v5.0.25, v5.0.26, v5.0.27, v5.0.28, v5.0.29, v5.0.3, v5.0.31,
v5.0.32, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9].
It seems that the indexes generation is kinda bugged in some cases.
I have a special use case: I have a database that is half
manually generated and half with migrations.
When you create indexes (On a single field) manually in phpMyAdmin, they are named after the field.
Ex: field parent_id
will generate the index parent_id
When you create indexes via migrations in laravel, they are named following a naming convention.
Ex: the migration line $table->index('parent_id');
on a table named module_module
will generate the index name ''module_module_parent_id_index".
Your package seems to use the index name as the field on which to execute the index command.
So I have lines like that in my generated migration:
$table->index('module_module_parent_id_index');
And obviously that line fails because there is no field named module_module_parent_id_index
.
it would be super cool if it could generate the proper index instructions ! =)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.