how to smoothly sync existing database with prisma...
# orm-help
u
how to smoothly sync existing database with prisma without losing data?
👀 2
r
Hi 👋 Have a look at this workflow specified in the docs for integrating Migrate with an existing database.
u
how to resolve when encounter these errors? ⚠️  There might be data loss when applying the changes:   • You are about to alter the column
created_at
on the
threaddislike
table, which contains 14 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
threaddislike
table, which contains 14 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
thread
on the
threaddislike
table, which contains 14 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
user
on the
threaddislike
table, which contains 14 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
postlike
table, which contains 42 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
postlike
table, which contains 42 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
like
on the
postlike
table, which contains 42 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
post
on the
postlike
table, which contains 42 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
user
on the
postlike
table, which contains 42 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
id
on the
settings
table, which contains 20 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
threadlike
table, which contains 82 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
threadlike
table, which contains 82 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
thread
on the
threadlike
table, which contains 82 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
user
on the
threadlike
table, which contains 82 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
redenvelopepost
table, which contains 1 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
redenvelopepost
table, which contains 1 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
post
on the
redenvelopepost
table, which contains 1 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
receiver
on the
redenvelopepost
table, which contains 1 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
red_envelope_thread
on the
redenvelopepost
table, which contains 1 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.
• You are about to alter the column
post
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
read
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
receiver
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
replier
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
sender
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
thread
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
message
table, which contains 263 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
author
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
category
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
deleted
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
dislikes
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
favorites
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
highlighted
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
id
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
last_post
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
last_reply
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
last_reply_at
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
likes
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
locked
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
login_required
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
replies
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.
• You are about to alter the column
created_at
on the
file
table, which contains 37 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
file
table, which contains 37 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
user
on the
file
table, which contains 37 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
follower
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
follower
on the
follower
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
id
on the
follower
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
user
on the
follower
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
favorite
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
favorite
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
owner
on the
favorite
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
thread
on the
favorite
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
favorite
table, which contains 25 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
created_at
on the
weixinpay
table, which contains 10 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
weixinpay
table, which contains 10 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
id
on the
admin
table, which contains 1 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
author
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
deleted
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
dislikes
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
id
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
likes
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
parent
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.
• You are about to alter the column
sticky
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
updated_at
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
visits
on the
thread
table, which contains 300 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
weixinuserbinding
table, which contains 13 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
weixinuserbinding
table, which contains 13 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
weixinuserbinding
table, which contains 13 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
user
on the
weixinuserbinding
table, which contains 13 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
category
on the
categoryparent
table, which contains 164 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
categoryparent
table, which contains 164 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
categoryparent
table, which contains 164 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
parent
on the
categoryparent
table, which contains 164 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
categoryparent
table, which contains 164 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
user
on the
categoryparent
table, which contains 164 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
drawn
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
id
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
paid
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
post
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
receiver
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
sender
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
thread
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
tip
table, which contains 33 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.
• You are about to alter the column
thread
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
post
table, which contains 294 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
created_at
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
drawn
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
id
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
paid
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
released
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
thread
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
user
on the
redenvelopethread
table, which contains 9 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
category
table, which contains 162 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
id
on the
category
table, which contains 162 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
official
on the
category
table, which contains 162 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
updated_at
on the
category
table, which contains 162 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
user
on the
category
table, which contains 162 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
active
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
blocked
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
collect_tag_count
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
collect_topic_count
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
created_at
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
followers
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.
• You are about to alter the column
followings
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
id
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
replies
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
retrieve_time
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
.   • You are about to alter the column
score
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
starred
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Boolean
.   • You are about to alter the column
threads
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
Int
.   • You are about to alter the column
updated_at
on the
user
table, which contains 1158 non-null values. The data in that column will be cast from
Unsupported("")
to
DateTime
. ✔️ Do you want to ignore the warning(s)? … yes Error: near ")": syntax error    0: sql_migration_connector:sql database step applier:apply_migration              at migration-engine/connectors/sql-migration-connector/src/sql_database_step_applier.rs:11    1: migration_core:api:SchemaPush              at migration-engine/core/src/api.rs:184
r
Ahh I see. This involves Unsupported data types so it would be great if you can create an issue here with your schema and the above messages so that we can look into this 🙂
u
ok