|
|
因调试过程中,发现有点问题,就把数据库表从其他客户端删除了,以为删除了就可以同步过去,没想到就是下面的结果。. Z' ]1 q: {4 q+ n( ]: H2 a, b
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py check0 v2 }) o: b* h, b! ^
System check identified no issues (0 silenced)." R' F$ c" n: X1 U2 r. F8 w) k& C
5 X% j8 I% b. c- S2 p' J(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations7 y$ L/ a i3 t o
No changes detected2 c3 Z j: \1 E
. f! D, O8 m) H$ `(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations order
8 Z- [! _) j |No changes detected in app 'order'
6 d9 p3 ~- b% ?+ d# U$ Z
( T; p# b- f: p2 U: J(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order9 Y+ E) P" z* _4 n$ B9 x3 h
Operations to perform:$ p* L+ k* ?5 C% L9 m; ~+ i+ s: @8 U
Apply all migrations: order% ]& B4 z, M- \- b* ~/ o+ p& c
Running migrations:5 w" k5 n/ U6 U2 X! A' J
No migrations to apply.3 R7 Q! D y3 y
: o( |' N" Y9 R9 u: v同步不过去,怎么办?
a. C1 z, I# J4 h# }0 {* Q看到有高手的同步经历,按照他的方法,去执行了下,好像问题解决了。
* V) O) _, e' d# { F- S8 R& w; s& T. G
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell6 t9 j0 k) G i* K e
Welcome to the MariaDB monitor. Commands end with ; or \g.5 {6 U5 A0 t% S% H
Your MariaDB connection id is 152
4 z4 p+ X5 L. H6 wServer version: 11.5.1-MariaDB mariadb.org binary distribution& f( c* w' h& l W5 L
. [: T9 u- p+ _: t
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
T+ C+ E6 S! n9 q
: }' ]) S% L1 a/ z4 qType 'help;' or '\h' for help. Type '\c' to clear the current input statement.
$ |3 F$ J. K5 O# p! P3 q8 ~
S" y6 F' [" E$ L# KMariaDB [tripsql]> show tables;
: ~4 U$ f: ~1 P) P0 J% E. Z) @9 v$ }+-------------------------------+9 f7 s o& x: P
| Tables_in_tripsql |
: ?; _' e% Z! v2 P+ u! O/ |; D) l+-------------------------------+
: k( G$ o( U* f| account_user |0 \4 ]% z6 g8 D! G+ V
| account_user_groups |" d# d! q0 @- @% i, c3 a7 B
| account_user_user_permissions |
* Y. L2 G; I! M+ a| accounts_login_record |
. |/ m* T3 Y! U- O: S6 p| accounts_user_profile |* T& T* R$ `6 C4 ]
| auth_group |" K, A1 V( A3 o- W% l0 W
| auth_group_permissions |. k8 N. }/ ~( K2 X
| auth_permission |# D* ^$ t+ h( o) [4 U6 ~
| auth_user |! N4 ~, y: }2 X2 Z. J
| auth_user_groups |
+ T, }% D/ p4 M2 S" T& f! {| auth_user_user_permissions |2 J+ W, H& l; A! M% O% l
| django_admin_log |
2 f7 ]2 v) v4 }* i2 v, B| django_content_type |- H7 ]7 h7 W$ J: Q/ ` L
| django_migrations |5 J+ t* u: m& S& w* {. ~9 f
| django_session | k# d! N+ i6 D- J/ o, i
| sight |; F4 n2 D5 N# e4 B, L7 w" R6 l ]- g
| sight_comment |) ?0 _7 \& j I, o; ^% j4 b3 k
| sight_info |; D1 i2 Q9 G6 R) L8 F
| sight_ticket |
& T+ T% J7 t8 I1 H8 l9 E" \+ O8 g| system_image_related |
2 W0 k: p2 Y7 p$ }8 A| system_slider |; M1 R0 E8 g$ C7 u
+-------------------------------+
# }# D/ R6 V& S7 D) k, R; @) R1 g21 rows in set (0.002 sec)4 } W% Y: e. e) D3 Y
+ U1 T2 W# Z: v& `% I. Y
. {1 Q5 Y" O' Z, o2 g9 K% _MariaDB [tripsql]> delete from django_migrations where app='order';
4 r9 Q; H- u) I; E7 ?7 }+ ?' oQuery OK, 2 rows affected (0.004 sec)# [( f6 [2 \& r; M: g" C! Z
9 \' o4 h8 t; y k6 w; XMariaDB [tripsql]> exit' Y4 Z# y% _+ c) W ~' S
Bye% S4 l( i! n& a& Z" I& X: _" G- W
+ E& T5 x( H o: K, Z/ m
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order2 C+ w3 O9 h9 z+ W: I! L. w/ Y
Operations to perform:
: j |# l" z) D' F; `; o& _. O7 A Apply all migrations: order
$ @4 L, D* \6 B3 ^Running migrations:
% [& m; z% k9 q0 q y: Q# `4 ?" X Applying order.0001_initial... OK
# D. p: j' N- Y* N' c: L0 p
. F& o5 i) p/ J9 j. Q$ v2 U6 U3 J. l(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>
: t2 E8 f% D' t6 g4 ^3 w6 C0 r" l这次成功同步过去了。9 r0 d8 x/ a& J8 T( l
0 }$ S& F5 ~6 d5 n c. w$ x1 Y3 v3 ^- X. t& F0 k: J; c
7 s2 o8 Y0 m: }1 V' S3 l. }( E6 l2 S- }+ d
* E0 D$ [! u* W
R; y* c( @0 l+ ~3 f- j9 N9 B6 V! h2 S8 x! c4 n1 O
5 l7 b3 \. N9 A/ ]3 |
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero" v# M& ]0 ], G+ r
Operations to perform:
4 W8 h$ |' _ R# W Unapply all migrations: order
; {% S) w7 I' z8 f2 {9 mRunning migrations:
; A+ o; _% F& q: ^( u1 U Rendering model states... DONE
, z# |- s) i' J0 }. Y Unapplying order.0001_initial... OK' R/ r3 V3 N" z1 ~1 p
K! j2 g" J( y/ g8 L4 Q( O1 t& d/ r9 t(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero+ R- [. i% C% G+ `# K- c6 x% Q
Operations to perform:9 Q8 \2 J( }: _4 ]/ D" ^$ N2 E
Unapply all migrations: order: a" X) d1 X b5 ~* x
Running migrations:2 ^) @( `0 @, V( ]3 X1 f" m9 ]
No migrations to apply.
5 R; ?3 n' } O( Z, S# N' _3 [; o, S5 b
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations --empty order- ~7 ]# F4 a/ Z6 }
Migrations for 'order':
! _1 p0 e# S _! h order\migrations\0002_auto_20250718_1752.py
" u7 A% g' Z" L; N
5 R7 ^* t9 ]- J- [1 p' N(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell
, ]- K* a! k+ j5 G0 `Welcome to the MariaDB monitor. Commands end with ; or \g.
% Y5 v' `! Q; N0 _Your MariaDB connection id is 162
4 I7 Z- [' F, a$ K# X! [ {: v0 WServer version: 11.5.1-MariaDB mariadb.org binary distribution
; y3 B9 b$ W) d) s) j) E* ?/ X7 ?
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
' `- H5 a1 g$ w6 S3 ?7 v. w2 E
! Q; _# k& |9 CType 'help;' or '\h' for help. Type '\c' to clear the current input statement.+ c2 P H( C9 B
2 C% ?1 }. q; E; zMariaDB [tripsql]> delete from django_migrations where app='order';- w h6 b1 c( O
Query OK, 0 rows affected (0.001 sec); |9 N2 G0 G# r1 J4 N0 x
! c3 m% B( G: _& O6 u
MariaDB [tripsql]>
1 A" _/ S- l! Z& Y' z ]4 d. X) p6 n
/ q9 N; k4 L9 I, o8 {. E. L& m
7 ?. g. l5 e$ b X( J7 Q! j. H9 U0 a5 P0 B5 [* r- o0 D
. E6 _& p- Z* K7 p/ h& v& o
: V2 {" ^9 j( h' j( m, |4 n
|
|