- 积分
- 16841
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
因调试过程中,发现有点问题,就把数据库表从其他客户端删除了,以为删除了就可以同步过去,没想到就是下面的结果。
3 S! O2 ~9 H; s( I' [; |(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py check2 x: X+ ~/ q: E W
System check identified no issues (0 silenced).
! J0 p6 ]+ g1 o3 Z* u# T6 v8 I) d
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations
, |5 ?& ~/ D3 _- z. l' [$ @+ kNo changes detected
5 W% {- |1 `3 _% t2 O
! e+ z9 ~. Y1 ?, V3 ^3 l(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations order
$ r4 H5 M) l3 u) P# j8 ]# qNo changes detected in app 'order'! @( D5 p% G4 K; k2 I
: B' y2 o4 r! |% l1 c(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order' c' Q; m0 C6 N; ^8 C0 M0 e
Operations to perform:! g' }9 Z' G" [. E( ]2 P
Apply all migrations: order( V2 k& }' O' V! Y$ c$ ?' d' T8 W# c/ H. y
Running migrations:
/ R; F+ o! ?/ r6 I1 K No migrations to apply.1 Z$ m; @' r6 w+ H
% ?" D) W% @4 y, k! v3 n+ T
同步不过去,怎么办?# L! D7 G6 W1 ~
看到有高手的同步经历,按照他的方法,去执行了下,好像问题解决了。
, S9 e! B4 p0 t0 R4 K) `- h! ? Z0 f
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell2 T3 G, @& Z# m# B: y7 X H
Welcome to the MariaDB monitor. Commands end with ; or \g.
7 L3 W* t q8 \5 \/ ~. ~' RYour MariaDB connection id is 152; J* D5 a# Y2 m9 n/ F
Server version: 11.5.1-MariaDB mariadb.org binary distribution% }2 V7 w0 g9 q) ~1 w
" z9 K! x( i/ |0 xCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
" K. e2 O# ~2 R, F/ {
. \/ {9 Q! P) g. J% J* ?/ [Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.7 j- A: | U4 V) [
* J$ h" A9 v( S+ N
MariaDB [tripsql]> show tables;9 u8 p3 D( J; c+ ^; s% g; ^
+-------------------------------+$ h3 x' r/ s! {' v6 t! D0 b% ~/ I, }
| Tables_in_tripsql |
, D, D2 d M8 h; M# a3 K, c0 x, h+-------------------------------+
) l0 F2 o) L" n. j& p| account_user |
( ~' v- n& L. [+ k2 v. X! e| account_user_groups |
2 ]) G6 j6 m% {8 ?) r2 c| account_user_user_permissions |
( q/ V( H4 L9 X. y, H| accounts_login_record |: f8 k! l5 W0 u
| accounts_user_profile |1 x' [- G; v2 [; q. W' N$ m4 _
| auth_group |- h9 k: K; Z2 H4 P9 q
| auth_group_permissions |
. S, L7 A$ n9 T2 V| auth_permission |6 z; _( u4 t/ W8 V0 }! {3 Z- m
| auth_user |' i% F2 D% a( l2 `
| auth_user_groups |
4 b7 R ~$ k& f9 x: }! T! t y| auth_user_user_permissions | E1 u5 K) n( v, K
| django_admin_log |
$ [1 u) ~! N: ]3 Z9 v8 p# ~| django_content_type |9 x# i+ U: c% P7 V, S# }0 s7 H
| django_migrations |
/ {0 v2 K- `% M( R| django_session |, s( Y, K# ]0 J: Q. d$ |" q) A) C
| sight |
3 N8 Z- B' C! | R| sight_comment |
3 a: ~. ]1 Z0 s! H; \, b( `) N| sight_info |
0 {$ P% d% v+ L6 ^( @: G* ^| sight_ticket |
# o8 e' x! u; f) z( C| system_image_related | w6 O7 P- r2 p) w" ?5 b/ d
| system_slider |
- A" N$ v! K( W, `% {+-------------------------------+$ G# R! w: q/ ^9 i" a, w2 X8 {
21 rows in set (0.002 sec)
7 `) R# d% [3 x! f1 m4 n- S+ L& w+ H' U6 L5 m* q* e) Y
( w: B, E& f! x4 n0 d6 M
MariaDB [tripsql]> delete from django_migrations where app='order';; G/ x$ o+ m- c$ @1 V
Query OK, 2 rows affected (0.004 sec)
. A. c- v+ U2 o" F% Y& w$ l; J4 E8 B% Z7 T
MariaDB [tripsql]> exit8 Y/ Z; F5 M+ J, r6 k0 ]
Bye
" q' v: x" N. q; U1 R& n2 g6 K/ C4 u) O3 |6 f
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order
; e) T; o$ T! V+ O* [Operations to perform:$ \+ g* ] ?5 m2 p
Apply all migrations: order
" j* p: _0 n+ t# J( mRunning migrations:; ~+ n) t3 B* |6 E
Applying order.0001_initial... OK
* ]) z* z3 L, a2 ? q: z! X2 _4 g0 X3 y0 M, I# [
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>" A% d" T( T/ s. I. X/ e
这次成功同步过去了。* t' V4 E3 o9 a6 c; N" j! ]
' k; z( ?# r- E& t) y; Z
6 D2 u( K$ g; _1 A; t& q
8 n1 ~/ O+ |! N) s
! r' I# o0 Q0 N* ~5 l2 m( a9 y4 S1 I, A0 ?
& {/ |: o0 B/ Q$ Z0 d0 D& n% q; b4 E* \1 j; |3 [2 ?
- e5 `3 o9 `5 k1 U* a
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero
4 {5 k! g. m& o7 q9 lOperations to perform:+ v" O) r. Z% I! `$ A
Unapply all migrations: order" Z+ q7 e- t3 A+ @! W ~7 M! x1 G
Running migrations:' e2 a! L. m1 g
Rendering model states... DONE' B7 f6 H; l7 u/ [
Unapplying order.0001_initial... OK9 S7 c8 Y2 ?, W$ y
3 B+ m6 N/ R/ f
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero0 r# @3 M* O5 v9 [
Operations to perform:8 ?7 }- R& X) J, b1 X
Unapply all migrations: order% U4 X& c' K" b& @
Running migrations:
: M) F- n# @# j; h2 N$ o- U No migrations to apply.
8 u/ @6 U9 E$ r3 i% b7 X0 i; H; n# q0 H3 p7 C2 S2 V
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations --empty order/ U; {6 y4 i% ~& b0 ~2 U* m
Migrations for 'order':( \$ F5 D- Y. C
order\migrations\0002_auto_20250718_1752.py3 `: \. o6 o( }& ]/ u
7 ^% Z1 |% b# ]! V% \
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell# a3 e2 i$ `; Z( Z1 H" A N; P
Welcome to the MariaDB monitor. Commands end with ; or \g.6 O. W! k @. e! C* e I( W$ C
Your MariaDB connection id is 162) w* ~: }' Y5 U% }
Server version: 11.5.1-MariaDB mariadb.org binary distribution
- p# s# `4 E" t, e% ?
" D* u' H i9 p4 y4 o$ tCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.' a3 O4 c0 y8 g% c
% d% E3 ~0 K. x. L
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
' B% g8 X# z7 P2 @" Y m) ?0 k% J% D$ z6 O' ~# @. L/ P
MariaDB [tripsql]> delete from django_migrations where app='order';
% u# |6 ~# } c: U! MQuery OK, 0 rows affected (0.001 sec)9 Q, M# ?' @" j7 l/ J" L
5 x8 m4 u. @6 c$ e2 t& ?
MariaDB [tripsql]>
% ~* Q2 ^5 u( j
& A y1 Q' I% Z
- E! ?* l' z m. s: {. g7 Q
4 G$ S+ O" \% B6 G; f; @- U4 ?6 ~/ \& R1 `8 ]9 r8 F
, j% j5 G8 X7 K( L8 J+ x
7 E1 p7 ]+ P. p# O' U' p
|
|