andig / dbcopy

Configurable database backup tool for volkszaehler.org
http://volkszaehler.org
3 stars 4 forks source link

Zeichensatzproblem (?) bei create auf SQLite #1

Closed J-A-U closed 8 years ago

J-A-U commented 8 years ago

Das create einer VZ-Datenbank von MySQL auf SQLite schlägt fehlt. Siehe auch: http://www.photovoltaikforum.com/volkszaehler-org-f131/vz-parallel-auf-raspi-und-webhoster--t110985.html#p1353934

php /var/www/volkszaehler.org/vendor/andig/dbcopy/dbcopy.php create -c /etc/dbcopy.json Creating target schema Renaming assets for target platform: sqlite table: aggregate table: data table: entities table: entities_in_aggregator table: properties Creating tables CREATE TABLE aggregate (id INTEGER NOT NULL, channel_id INTEGER NOT NULL, type BOOLEAN NOT NULL, timestamp BIGINT NOT NULL, value DOUBLE PRECISION NOT NULL, count INTEGER NOT NULL, PRIMARY KEY(id)) CREATE UNIQUE INDEX ts_uniq ON aggregate (channel_id, type, timestamp) CREATE TABLE data (id INTEGER NOT NULL, channel_id INTEGER DEFAULT NULL, timestamp BIGINT NOT NULL, value DOUBLE PRECISION NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_ADF3F36372F5A1AA FOREIGN KEY (channel_id) REFERENCES entities (id) NOT DEFERRABLE INITIALLY IMMEDIATE) CREATE UNIQUE INDEX data_unique ON data (channel_id, timestamp) CREATE INDEX IDX_ADF3F36372F5A1AA ON data (channel_id) CREATE TABLE entities (id INTEGER NOT NULL, uuid VARCHAR(36) NOT NULL COLLATE utf8_unicode_ci, type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, class VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, PRIMARY KEY(id)) CREATE UNIQUE INDEX UNIQ_50EC64E5D17F50A6 ON entities (uuid) CREATE TABLE entities_in_aggregator (parent_id INTEGER NOT NULL, child_id INTEGER NOT NULL, PRIMARY KEY(parent_id, child_id), CONSTRAINT FK_2BD88468727ACA70 FOREIGN KEY (parent_id) REFERENCES entities (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_2BD88468DD62C21B FOREIGN KEY (child_id) REFERENCES entities (id) NOT DEFERRABLE INITIALLY IMMEDIATE) CREATE INDEX IDX_2BD88468727ACA70 ON entities_in_aggregator (parent_id) CREATE INDEX IDX_2BD88468DD62C21B ON entities_in_aggregator (child_id) CREATE TABLE properties (id INTEGER NOT NULL, entity_id INTEGER DEFAULT NULL, pkey VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, value CLOB NOT NULL COLLATE utf8_unicode_ci, PRIMARY KEY(id), CONSTRAINT FK_87C331C781257D5D FOREIGN KEY (entity_id) REFERENCES entities (id) NOT DEFERRABLE INITIALLY IMMEDIATE) CREATE UNIQUE INDEX property_unique ON properties (entity_id, pkey) CREATE INDEX IDX_87C331C781257D5D ON properties (entity_id)

[Doctrine\DBAL\Exception\DriverException]
An exception occurred while executing 'CREATE TABLE entities (id INTEGER NOT NULL, uuid VARCHAR(36) NOT NULL COLLATE utf8_unicode_ci, type VARCHAR(255
) NOT NULL COLLATE utf8_unicode_ci, class VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, PRIMARY KEY(id))':
SQLSTATE[HY000]: General error: 1 no such collation sequence: utf8_unicode_ci

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000]: General error: 1 no such collation sequence: utf8_unicode_ci

[PDOException]
SQLSTATE[HY000]: General error: 1 no such collation sequence: utf8_unicode_ci

andig commented 8 years ago

Workaround: Zielschema von Hand anlegen. Einfach mittels misc/tools/doctrine.php orm:schematool create anlegen.

J-A-U commented 8 years ago

Habs hinbekommen. Im Detail: http://www.photovoltaikforum.com/volkszaehler-org-f131/vz-parallel-auf-raspi-und-webhoster--t110985.html#p1354283

andig commented 8 years ago

Wie sieht denn Deine dbcopy.json dazu aus?

J-A-U commented 8 years ago

dbcopy-sqlite.json.txt

andig commented 8 years ago

Fixed via https://github.com/andig/dbcopy/pull/2