Exporting a version

As the complete SQL code at the time of creation for a specific version has been stored along with all of the tracked statements that occurred since that moment, we might want to reuse them in their executable form. At the bottom of the Tracking report panel, an Export as dialog is available, offering three variants for exporting. If we choose SQL dump (file download) menu option, then all of the statements stored for this version are transferred in a file that we can save to our workstation. For the author table, this would produce a file containing the following lines:

# Tracking report for table `author`
# 2011-10-14 14:24:12
DROP TABLE IF EXISTS `author`;
CREATE TABLE `author` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`phone` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
`country_code` char(2) NOT NULL,
`total_page_count` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `author` CHANGE `name` `name` VARCHAR(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
UPDATE `author` SET `phone` = '111-2222' WHERE `author`.`id` = 1;

If, instead, we pick the SQL dump choice, the statements appear on screen in a text area; from this point we could cut and paste the SQL code or click on Go to run it. As a measure of precaution, extra statements are generated on top of the code; these handle the creation of another database in which the table would be created. Of course the user must have the rights to create this database.

Finally, the SQL execution choice permits to directly execute the stored statements in the current database. However, a warning message is issued as these statements might reflect an older state of the table; we might not want to revert to this old state. Also, the first statement is, by default, a DROP TABLE, which may or may not succeed depending on whether some foreign key constraint blocks the deletion of the table.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.189.23