Conversation
Fix test default field
Add last_value and is_called fields to the sequence test.
Get sequence last_value and is_called
getSequenceLastValue getSequenceIsCalled Rename test table.
|
PostgreSQL automatically creates a unique index when a unique constraint or primary key is defined for a table. We need to modify table by adding a unique constraint on a column, instead of creating a unique index. Here, a unique constraint is defined for a table: |
This creates a unique index.
Co-Authored-By: twister65 <olaverre@free.fr>
table_structure name
| foreach ($this->from as $table) | ||
| { | ||
| // Replace the magic prefix if found. | ||
| $table = $this->getGenericTableName($table); |
There was a problem hiding this comment.
This needs to be restored. The tables should be exported with magic prefix, I think. At least MySQLi does it.
There was a problem hiding this comment.
Completed. Do you also want a magic prefix for the sequence name and key index?
There was a problem hiding this comment.
There was a problem hiding this comment.
I think so. To my understanding, exported XML files should not contain real DB prefix. It should be replaced when importing. Maybe @alikon knows more.
There was a problem hiding this comment.
Done. However, the key query can't contain the magic prefix.
There was a problem hiding this comment.
To my understanding, exported XML files should not contain real DB prefix. It should be replaced when importing.
correct
There was a problem hiding this comment.
In that case more changes are needed because Query and Default attributes contain it, e.g.:
<field Field="id" Type="integer" Null="NO" Default="nextval('pg39_action_logs_id_seq'::regclass)" Comments="" />
and
<key Index="#__action_logs_idx_user_id_extension" is_primary="f" is_unique="f" Key_name="user_id, extension" Query='CREATE INDEX pg39_action_logs_idx_user_id_extension ON pg39_action_logs USING btree (user_id, extension)' />
107 | WARNING | Line exceeds 150 characters; contains 168 characters
|
not so sure if this work can really have a chance to be merged on 3.X branch, i will hope so |
|
@HLeithner comment on above Question by @alikon please? |
|
I'm sorry but this is a new feature and has to go into j4 |
|
@twister65 can you rebase this PR on J4? |
|
Yes, I can rebase this PR in the Joomla Framework Database Package: |
Rebase PR joomla#23320
|
Closed as rebased on J4. |
* Database exporter importer Rebase PR #23320 * Classname * Add Database Console Application * Register Export and Import Commands * Add commands paths * Use Joomla Console php cli/joomla.php * Database Joomla/Console Application To import in a new database * Remove DatabaseConsole * Sort in alpha order.
Retrieving PR #14272 (and #10991) to fix the PostgreSQL exporter and importer bugs.
This PR can be tested with any database driver supported by Joomla.
This is about exporting and importing any database with a command-line interface (it can be placed in cronjob to schedule the database backup).
Summary of Changes
last_valueandis_calledsequence attributes.Testing Instructions
php exporter.php --all --folder <folder_path>php importer.php --all --folder <folder_path>You can also :
php exporter.php --all --mode zipphp exporter.php --table <table_name>php exporter.php --table <table_name> --mode zipphp importer.php --table <table_name>Expected result
Export/import tables with structure (keys, constraints, sequences) and data.
Actual result
Does not export/import views, stored procedures and triggers (optional for the Joomla database).