A simple Python tool to transfer data from MySQL to SQLite 3.

Overview

PyPI Downloads PyPI - Python Version MySQL Support MariaDB Support GitHub license Contributor Covenant Code style: black Codacy Badge Build Status codecov GitHub stars

MySQL to SQLite3

A simple Python tool to transfer data from MySQL to SQLite 3.

This is the long overdue complimentary tool to my SQLite3 to MySQL. It transfers all data from a MySQL database to a SQLite3 database.

How to run

pip install mysql-to-sqlite3
mysql2sqlite --help

Usage

Usage: mysql2sqlite [OPTIONS]

  Transfer MySQL to SQLite using the provided CLI options.

Options:
  -f, --sqlite-file PATH          SQLite3 database file  [required]
  -d, --mysql-database TEXT       MySQL database name  [required]
  -u, --mysql-user TEXT           MySQL user  [required]
  -p, --prompt-mysql-password     Prompt for MySQL password
  --mysql-password TEXT           MySQL password
  -t, --mysql-tables TUPLE        Transfer only these specific tables (space
                                  separated table names). Implies --without-
                                  foreign-keys which inhibits the transfer of
                                  foreign keys.

  -L, --limit-rows INTEGER        Transfer only a limited number of rows from
                                  each table.

  -C, --collation [BINARY|NOCASE|RTRIM]
                                  Create datatypes of TEXT affinity using a
                                  specified collation sequence.  [default:
                                  BINARY]

  -K, --prefix-indices            Prefix indices with their corresponding
                                  tables. This ensures that their names remain
                                  unique across the SQLite database.

  -X, --without-foreign-keys      Do not transfer foreign keys.
  -W, --without-data              Do not transfer table data, DDL only.
  -h, --mysql-host TEXT           MySQL host. Defaults to localhost.
  -P, --mysql-port INTEGER        MySQL port. Defaults to 3306.
  -S, --skip-ssl                  Disable MySQL connection encryption.
  -c, --chunk INTEGER             Chunk reading/writing SQL records
  -l, --log-file PATH             Log file
  --json-as-text                  Transfer JSON columns as TEXT.
  -V, --vacuum                    Use the VACUUM command to rebuild the SQLite
                                  database file, repacking it into a minimal
                                  amount of disk space

  --use-buffered-cursors          Use MySQLCursorBuffered for reading the
                                  MySQL database. This can be useful in
                                  situations where multiple queries, with
                                  small result sets, need to be combined or
                                  computed with each other.

  -q, --quiet                     Quiet. Display only errors.
  --version                       Show the version and exit.
  --help                          Show this message and exit.
Comments
  • Default column value not getting converted from mysql

    Default column value not getting converted from mysql

    Describe the bug The default column values don't seem to get converted to sqlite. Here's the command that was run to generate the output:

    mysql2sqlite -f mydb.db -d mydb -u myuser --mysql-password mypwd -t dispatcher
    

    Here's the actual table schema in mysql 5.7:

    CREATE TABLE `dispatcher` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `setid` int(11) NOT NULL DEFAULT '0',
      `destination` varchar(192) NOT NULL DEFAULT '',
      `flags` int(11) NOT NULL DEFAULT '0',
      `priority` int(11) NOT NULL DEFAULT '0',
      `attrs` varchar(128) NOT NULL DEFAULT '',
      `description` varchar(64) NOT NULL DEFAULT '',
      PRIMARY KEY (`id`),
      UNIQUE KEY `description` (`description`) USING BTREE
    ) ENGINE=InnoDB AUTO_INCREMENT=595 DEFAULT CHARSET=latin1;
    

    Expected behaviour

    sqlite> .schema dispatcher
    CREATE TABLE "dispatcher" (
    	"id" INTEGER NOT NULL,
    	"setid" INTEGER NOT NULL DEFAULT '0',
    	"destination" VARCHAR(192) NOT NULL DEFAULT '',
    	"flags" INTEGER NOT NULL DEFAULT '0',
    	"priority" INTEGER NOT NULL DEFAULT '0',
    	"attrs" VARCHAR(128) NOT NULL DEFAULT '',
    	"description" VARCHAR(64) NOT NULL DEFAULT '',
    	PRIMARY KEY ("id")
    );
    CREATE UNIQUE INDEX "dispatcher_description" ON "dispatcher" ("description");
    

    Actual result

    sqlite> .schema dispatcher
    CREATE TABLE "dispatcher" (
    	"id" INTEGER NOT NULL,
    	"setid" INTEGER NOT NULL,
    	"destination" VARCHAR(192) NOT NULL,
    	"flags" INTEGER NOT NULL,
    	"priority" INTEGER NOT NULL,
    	"attrs" VARCHAR(128) NOT NULL,
    	"description" VARCHAR(64) NOT NULL,
    	PRIMARY KEY ("id")
    );
    CREATE UNIQUE INDEX "dispatcher_description" ON "dispatcher" ("description");
    

    System Information

    $ mysql2sqlite --version
    

    | software | version | |------------------------|-----------------------------------------------------------------------------| | mysql-to-sqlite3 | 1.4.0 | | | | | Operating System | Linux 3.10.0-1160.2.2.el7.x86_64 | | Python | CPython 2.7.5 | | MySQL | mysql Ver 14.14 Distrib 5.7.32, for Linux (x86_64) using EditLine wrapper | | SQLite | 3.7.17 | | | | | click | 7.1.2 | | mysql-connector-python | 8.0.23 | | python-slugify | 5.0.0 | | pytimeparse | 1.1.8 | | simplejson | 3.17.2 | | six | 1.9.0 | | tabulate | 0.8.9 | | tqdm | 4.61.1 |

    BTW, thanks for this tool. It seems to work very well. I've tried others and they all failed to produce a production ready sqlite export but this one seems great :)

    bug enhancement 
    opened by jmordica 16
  • get table list error when click package is 8.0+

    get table list error when click package is 8.0+

    Describe the bug get table list error when click package is 8.0+

    Expected behaviour when i run mysql-to-sqlite3 , but table list is some wrong .

    Actual result install the package click when 7.1.2

    System Information

    $ mysql2sqlite --version
    
    bug 
    opened by luyinhua 13
  • Can't have a name column in our table is this normal ?

    Can't have a name column in our table is this normal ?

    Describe the bug The programm is stoping because i have a name column in one of my table.

    Expected behaviour I expect that the programm works normally even if i have this name column

    Actual result It stopped

    invalid 
    opened by MaximeBrt 7
  • Support for UTF8

    Support for UTF8

    Is your feature request related to a problem? Please describe. When converting a database that has utf8 characters the values are converted to numeric values. For example Произошла is turned to 208,159,209,128,208,190,208,184,208,183,208,190,209,136,208,187,208,176

    Describe the solution you'd like It should convert the characters correctly. Maybe add a --utf8 parameter to enable utf8 support.

    python2 
    opened by alvarengasv 7
  • Feature update -exclude to exclude tables

    Feature update -exclude to exclude tables

    Merged queries and added option to filter out tables using exclude keyword.

    May need to be fixed to allow for correct use of -exclude tag with --without-foreign-keys May be worth adding an else statement to remove 'exclude' filter if 'mysql_tables' filter is set. Code formatting may be needed.

    Merged --mysql-tables and --exclude (or none) into single query.

    opened by AceScottie 6
  • Indexes are being created twice

    Indexes are being created twice

    Describe the bug I have a MySQL database with some indexes. When I convert it to SQLite every index is being created twice. Once with "indexname" and once with "tablename_indexname". This results in an invalid scheme for Android Room, since there are too many indexes, which makes it quite problematic.

    Expected behaviour Index should only be created once or there should be an option, that disables the doubled creation. (In case some programs need the "tablename_indexname" naming.)

    System Information

    $ mysql2sqlite --version
    
    | software               | version                              |
    |------------------------|--------------------------------------|
    | mysql-to-sqlite3       | 1.4.4                                |
    |                        |                                      |
    | Operating System       | Windows 10                           |
    | Python                 | CPython 3.8.2                        |
    | MySQL                  | MySQL client not found on the system |
    | SQLite                 | 3.28.0                               |
    |                        |                                      |
    | click                  | 8.0.1                                |
    | mysql-connector-python | 8.0.26                               |
    | python-slugify         | 5.0.2                                |
    | pytimeparse            | 1.1.8                                |
    | simplejson             | 3.17.3                               |
    | six                    | 1.16.0                               |
    | tabulate               | 0.8.9                                |
    | tqdm                   | 4.62.0                               |```
    
    
      + MariaDB 10.4.11 (with XAMPP)
    
    
    enhancement 
    opened by Sahara150 6
  • Conversion from MariaDB in encoding utf8mb4 to sqlite with utf8 produces invalid encoding output

    Conversion from MariaDB in encoding utf8mb4 to sqlite with utf8 produces invalid encoding output

    When I convert my MySQL database to a SQLite Database, it produces some weird output and my IDE tells me, that this doesn´t seem to be UTF-8 for sure. The output begins like this:

    SQLite format 3   @     G  ·           9                                                 G .4    ñ   ™ûöñë	.Çãp&·“*"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             g=indexfrench_index_French_typefrenchCREATE INDEX "french_index_French_type" ON "french" ("type")pC
    

    And then continues with the text, having weird symbols from time to time.

    Versions:

    OS: Windows 10 Home
    MariaDB: 10.4.11
    Python: 3.8.2
    

    MySQL-Encoding info from dump:

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8mb4 */;
    

    All the tables are in utf8mb4 encoding, since it also contains letters like é, ç, ā, ä, etc. (most of them are also part of utf8, but I am not sure about all of them)

    invalid 
    opened by Sahara150 5
  • Foreign key contraints multiple times in table definition after conversion

    Foreign key contraints multiple times in table definition after conversion

    Hi! Appreciate your work!

    from the source database, this is the table I refer to:

    Bildschirmfoto 2020-02-06 um 15 33 46

    After I called mysql2sqlite -f ./test.sqlite -d mydb -u myusername -p mypassword -l ./log.txt -V converting was successful.

    Though with sqlite> .schema glossar I got this result:

    CREATE TABLE IF NOT EXISTS "glossar" ( "id" INTEGER NOT NULL, "glossar_key" VARCHAR(255) NOT NULL, "translation_id" INTEGER NOT NULL, "translation_id_for_key" INTEGER NOT NULL, PRIMARY KEY ("id"), FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION, FOREIGN KEY("translation_id_for_key") REFERENCES "translations_de" ("id") ON UPDATE NO ACTION ON DELETE NO ACTION );

    bug 
    opened by webnautics 5
  • Unknown character set: 'utf8mb4'

    Unknown character set: 'utf8mb4'

    Installed Python 3.8.1 on Windows 10, used pip to install, tried to run the command on a test schema and a single table with just an id and varchar column with 1 row with 'test' in column.

    Any ideas what's causing this?

    C:\Users\User>mysql2sqlite --sqlite-file "C:\Temp\testdb.db" --mysql-database "sqlite_test" --mysql-user user --mysql-password pass
    2020-02-04 18:33:43 ERROR    1115 (42000): Unknown character set: 'utf8mb4'
    1115 (42000): Unknown character set: 'utf8mb4'
    
    invalid 
    opened by snblackout 5
  • Error converting empty table?

    Error converting empty table?

    Conversion fails when the script hits an empty table:

    └─ $ ▶ ./mysql2sqlite.py -f output.sqlite -u root -p '' -d ITIS
    2019-04-16 07:43:23 INFO     Transferring table change_comments
    0it [00:00, ?it/s]
    2019-04-16 07:43:23 ERROR    _create_table failed creating table change_operations: Unread result found
    

    By dropping all the empty tables, I was able to get the script to run to completion. It seems to bail out after creating the empty table, because the dropped tables do show up in my sqlite version.

    Thanks for creating this ... huge help!

    bug 
    opened by philmitchell 5
  • Exclude tables from copying.

    Exclude tables from copying.

    Please add the ability to exclude tables from being downloaded (using phpmyadmin so there are a lot of pma_* tables)

    The fix i implemented from pypi download so i can use:

        def __init__(self, **kwargs):
            #...
            self._exclude = kwargs.get("exclude") or []
            #...
        def transfer(self):
            """The primary and only method with which we transfer all the data."""
            filtered = [] # ensure there is a valid list object
            if len(self._exclude) > 0:
                self._mysql_cur_prepared.execute(
                    """
                    SELECT TABLE_NAME
                    FROM information_schema.TABLES
                    WHERE TABLE_SCHEMA = SCHEMA()
                    {exclude_format}
                """.format(
                    exclude_format = ('AND ({phrase})').format(phrase=' OR '.join(['TABLE_NAME LIKE "{e}"'.format(e="%{exclude}%".format(exclude=x)) for x in self._exclude])) # this line may need cleaning up a bit, it just formats the list into sql string.
                    )
                ) # SELECT ... AND (TABLE LIKE "%pma%" OR TABLE_NAME LIKE "%admin%") 
                filtered = ("'%s'"%row[0] for row in self._mysql_cur_prepared.fetchall()) # returns list of exluded tables
            if len(self._mysql_tables) > 0:
                # transfer only specific tables
    
                self._mysql_cur_prepared.execute(
                    """
                    SELECT TABLE_NAME
                    FROM information_schema.TABLES
                    WHERE TABLE_SCHEMA = SCHEMA()
                    AND TABLE_NAME IN ({placeholders})
                    AND TABLE_NAME NOT IN ({filtered})
                """.format(
                        placeholders=', '.join(self._mysql_tables), # quick fix
                        filtered = ','.join(filtered) # added filter option 
                    )
                )
                tables = (row[0] for row in self._mysql_cur_prepared.fetchall())
            else:
                # transfer all tables
                self._mysql_cur.execute(
                    """
                    SELECT TABLE_NAME
                    FROM information_schema.TABLES
                    WHERE TABLE_SCHEMA = SCHEMA()
                    AND TABLE_NAME NOT IN ({filtered})
                """.format(filtered = ', '.join(filtered)) # added filter option 
                )
                tables = (row[0].decode() for row in self._mysql_cur.fetchall())
    

    This solution can probably be merged with the existing SELECT TABLE_NAME statements, i made it separate to keep track of it.

    Also: https://github.com/techouse/mysql-to-sqlite3/blob/8558f1c78cd27e99407da81e976e6b7666829c4e/mysql_to_sqlite3/transporter.py#L506 can be replace with placeholders=', '.join(self._mysql_tables) for a bit easier reading (included in example above as well).

    enhancement 
    opened by AceScottie 4
  • SQLite failed creating table revision: unrecognized token:

    SQLite failed creating table revision: unrecognized token: "'"

    Describe the bug When trying to convert a database, I receive an error about a quote character '. I thought it may be due to the character being a value in the table rows - however I updated this as a troubleshooting test - and still get the same error.

    Expected behaviour No Error

    Actual result 2022-12-12 03:12:11 INFO Transferring table revision 2022-12-12 03:12:11 ERROR SQLite failed creating table revision: unrecognized token: "'"

    System Information | software | version | |------------------------|--------------------------------------| | mysql-to-sqlite3 | 1.4.14 | | | | | Operating System | Linux 5.15.64-0-virt | | Python | CPython 2.7.18 | | MySQL | MySQL client not found on the system | | SQLite | 3.30.1 | | | | | click | 7.1.2 | | mysql-connector-python | 8.0.23 | | python-slugify | 4.0.1 | | pytimeparse | 1.1.8 | | simplejson | 3.18.0 | | six | 1.16.0 | | tabulate | 0.8.5 | | tqdm | 4.64.1 |

    Additional context Traceback (most recent call last): File "/usr/local/bin/mysql2sqlite", line 8, in 2022-12-12 03:19:16 ERROR SQLite failed creating table revision: unrecognized token: "'" sys.exit(cli()) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 829, in call return self.main(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python2.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python2.7/site-packages/mysql_to_sqlite3/cli.py", line 183, in cli converter.transfer() File "/usr/local/lib/python2.7/site-packages/mysql_to_sqlite3/transporter.py", line 554, in transfer self._create_table(table_name) File "/usr/local/lib/python2.7/site-packages/mysql_to_sqlite3/transporter.py", line 409, in _create_table self._sqlite_cur.executescript(self._build_create_table_sql(table_name)) sqlite3.OperationalError: unrecognized token: "'"

    need more info 
    opened by dresken 13
Owner
Klemen Tusar
Senior PHP Developer at CMC Markets
Klemen Tusar
A wrapper for SQLite and MySQL, Most of the queries wrapped into commands for ease.

Before you proceed, make sure you know Some real SQL, before looking at the code, otherwise you probably won't understand anything. Installation pip i

Refined 4 Jul 30, 2022
Creating a python package to convert /transfer excelsheet data to a mysql Database Table

Creating a python package to convert /transfer excelsheet data to a mysql Database Table

Odiwuor Lameck 1 Jan 7, 2022
A tool to snapshot sqlite databases you don't own

The core here is my first attempt at a solution of this, combining ideas from browser_history.py and karlicoss/HPI/sqlite.py to create a library/CLI tool to (as safely as possible) copy databases which may be in use from other applications

Sean Breckenridge 10 Dec 22, 2022
Create a database, insert data and easily select it with Sqlite

sqliteBasics create a database, insert data and easily select it with Sqlite Watch on YouTube a step by step tutorial explaining this code: https://yo

Mariya 27 Dec 27, 2022
Sample code to extract data directly from the NetApp AIQUM MySQL Database

This sample code shows how to connect to the AIQUM Database and pull user quota details from it. AIQUM Requirements: 1. AIQUM 9.7 or higher. 2. An

null 1 Nov 8, 2021
A supercharged SQLite library for Python

SuperSQLite: a supercharged SQLite library for Python A feature-packed Python package and for utilizing SQLite in Python by Plasticity. It is intended

Plasticity 703 Dec 30, 2022
A tutorial designed to introduce you to SQlite 3 database using python

SQLite3-python-tutorial A tutorial designed to introduce you to SQlite 3 database using python What is SQLite? SQLite is an in-process library that im

null 0 Dec 28, 2021
MySQL database connector for Python (with Python 3 support)

mysqlclient This project is a fork of MySQLdb1. This project adds Python 3 support and fixed many bugs. PyPI: https://pypi.org/project/mysqlclient/ Gi

PyMySQL 2.2k Dec 25, 2022
MySQL database connector for Python (with Python 3 support)

mysqlclient This project is a fork of MySQLdb1. This project adds Python 3 support and fixed many bugs. PyPI: https://pypi.org/project/mysqlclient/ Gi

PyMySQL 2.2k Dec 25, 2022
Pure Python MySQL Client

PyMySQL Table of Contents Requirements Installation Documentation Example Resources License This package contains a pure-Python MySQL client library,

PyMySQL 7.2k Jan 9, 2023
A Relational Database Management System for a miniature version of Twitter written in MySQL with CLI in python.

Mini-Twitter-Database This was done as a database design course project at Amirkabir university of technology. This is a relational database managemen

Ali 12 Nov 23, 2022
A library for python made by me,to make the use of MySQL easier and more pythonic

my_ezql A library for python made by me,to make the use of MySQL easier and more pythonic This library was made by Tony Hasson , a 25 year old student

null 3 Nov 19, 2021
Script em python para carregar os arquivos de cnpj dos dados públicos da Receita Federal em MYSQL.

cnpj-mysql Script em python para carregar os arquivos de cnpj dos dados públicos da Receita Federal em MYSQL. Dados públicos de cnpj no site da Receit

null 17 Dec 25, 2022
Implementing basic MySQL CRUD (Create, Read, Update, Delete) queries, using Python.

MySQL with Python Implementing basic MySQL CRUD (Create, Read, Update, Delete) queries, using Python. We can connect to a MySQL database hosted locall

MousamSingh 5 Dec 1, 2021
Python MYSQL CheatSheet.

Python MYSQL CheatSheet Python mysql cheatsheet. Install Required Windows(WAMP) Download and Install from HERE Linux(LAMP) install packages. sudo apt

Mohammad Dori 4 Jul 15, 2022
aiomysql is a library for accessing a MySQL database from the asyncio

aiomysql aiomysql is a "driver" for accessing a MySQL database from the asyncio (PEP-3156/tulip) framework. It depends on and reuses most parts of PyM

aio-libs 1.5k Jan 3, 2023
Pandas on AWS - Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretManager, PostgreSQL, MySQL, SQLServer and S3 (Parquet, CSV, JSON and EXCEL).

AWS Data Wrangler Pandas on AWS Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretMana

Amazon Web Services - Labs 3.3k Dec 31, 2022
MySQL Operator for Kubernetes

MySQL Operator for Kubernetes The MYSQL Operator for Kubernetes is an Operator for Kubernetes managing MySQL InnoDB Cluster setups inside a Kubernetes

MySQL 462 Dec 24, 2022
Class to connect to XAMPP MySQL Database

MySQL-DB-Connection-Class Class to connect to XAMPP MySQL Database Basta fazer o download o mysql_connect.py e modificar os parâmetros que quiser. E d

Alexandre Pimentel 4 Jul 12, 2021