I want to migrate from existing sqlite db to mariadb. And the import in 
mariadb fails because of the different field order (wrong type, wrong data)

Am Mittwoch, 4. März 2020 10:48:56 UTC+1 schrieb Dave S:
>
>
>
> On Monday, March 2, 2020 at 11:19:10 AM UTC-8, Jörg Schneider wrote:
>>
>> I tried to migrate from sqlite database to mysql/mariadb but following 
>> the instructions on 
>> https://realpython.com/web2py-migrating-from-sqlite-to-mysql/ didn't 
>> work for me, because of different database scheme created by dal on mysql 
>> database. Unfortunately "fake_migrate=True" didn't work either.
>>
>> For example:
>>
>> db.define_table('repo', 
>>                 Field('title', requires=IS_NOT_EMPTY(), 
>> label='Liedtitel'),
>>                 Field('composer', default='unbekannt', label='Komponist'),
>>                 Field('lyrics', label='Liedtext'),
>>                 Field('arrangement', label='Liedsatz'),
>>                 Field('biblical', label='Bibelstelle'),
>>                 Field('genre', 'reference repository_genre', default='2'),
>>                 Field('purpose',requires=IS_IN_SET(PURPOSES), 
>> default=PURPOSES[0], label='Satz für'),
>>                 Field('pdf', 'upload', 
>> uploadfolder=os.path.join(request.folder, 'static/repository'), 
>> label='PDF-Datei'),
>>                 Field('transl', type='text', label='Übersetzung'),
>>                 Field('transl_file', 'upload', 
>> uploadfolder=os.path.join(request.folder, 'static/repository'), 
>> label='Anhang zur Übersetzung'),
>>                 auth.signature,
>>                 format='%(title)s %(composer)s'
>>                ) 
>>
>> has following table in *sqlite*:
>>
>>
>>    1. id
>>    2. title
>>    3. composer
>>    4. lyrics
>>    5. arrangement
>>    6. *genre*
>>    7. 
>> *pdf *
>>    8. 
>> *transl *
>>    9. 
>> *transl_file *
>>    10. 
>> *status *
>>    11. 
>> *purpose *
>>    12. 
>> *biblical *
>>    13. 
>> *modified_by *
>>    14. 
>> *created_by *
>>    15. 
>> *created_on *
>>
>>
>> which has other order than created on the *mysql* table:
>>
>>
>>    1. id
>>    2. title
>>    3. composer
>>    4. lyrics
>>    5. arrangement
>>    6. biblical
>>    7. genre
>>    8. purpose
>>    9. pdf
>>    10. transl
>>    11. transl_file
>>    12. created_on
>>    13. created_by
>>    14. modified_on
>>    15. modified_by
>>    
>>
>
> How does the different field order affect you?  DAL query results within a 
> row are accessed by field name.  DAL inserts and updates also use field 
> names, no?
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ad5ed150-bae3-43c4-9503-26e4572a4a11%40googlegroups.com.

Reply via email to