- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
因调试过程中,发现有点问题,就把数据库表从其他客户端删除了,以为删除了就可以同步过去,没想到就是下面的结果。
, A6 X1 ^- ]2 b5 t |0 y! M" _6 {(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py check
7 p, ^ q) O- _' F9 ?: cSystem check identified no issues (0 silenced). c* v+ x* h/ q' g) N: y
. {+ J6 {: r! V7 A0 w( c9 l
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations5 G. H- f9 S* r% |, r3 V8 ^) J/ w
No changes detected$ R9 g& w* f. N
/ R' F% t; G0 y' b3 U7 F5 I5 q(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations order: C& {1 `& g2 ?( Q
No changes detected in app 'order'
3 d$ k1 x) ^1 E& c# X8 j- Q/ B7 ~, @+ l6 o+ |+ C5 a. x
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order4 J+ p1 S$ }, x j
Operations to perform:5 N, W9 m, n7 x8 ~2 i6 Q1 O
Apply all migrations: order
# U5 v4 j1 v, h! `( \% j uRunning migrations:8 {, |/ _+ g) x+ w
No migrations to apply.! S& s1 L. i0 [7 e0 A
. x/ V3 [8 n* R3 q" `
同步不过去,怎么办?
, W. X8 M: K4 u& _看到有高手的同步经历,按照他的方法,去执行了下,好像问题解决了。
4 y# ?6 q9 S, g7 x0 v. V' w8 m# \; p5 Q; m$ X) g
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell* L3 ^0 k/ g; t; I
Welcome to the MariaDB monitor. Commands end with ; or \g.
: d$ g( e" V" t( k$ S2 B* DYour MariaDB connection id is 1524 m0 U2 u$ ^6 Z/ j& _$ h8 C
Server version: 11.5.1-MariaDB mariadb.org binary distribution
/ Y. E/ u% O0 ~, L$ Q: m K& H
& g, @& Q2 A% Z# m( @8 Z- lCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others., C5 R' w- w% y" I- r3 Q% R
$ w" ?3 u% \4 F- Y2 o7 q$ c1 n ]
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.* i- \3 ^* v0 V+ t- U5 i5 L) M7 H
; U, K) R9 V& L- e5 \1 p: I7 c4 c* [
MariaDB [tripsql]> show tables;) }7 R: f2 l% J/ T3 R& t, ?4 Y4 v
+-------------------------------+' m- @0 M7 _& H% ?8 D8 T
| Tables_in_tripsql |
: Q! h5 [- }: [1 m/ _$ ]% C9 C+-------------------------------+3 i/ m9 l) f$ m( V- C r
| account_user |& C+ ?% M3 w- t; }- Y6 b! h
| account_user_groups |0 ~; F% _$ U) v I, W1 p9 M
| account_user_user_permissions |; w5 k& @9 C% x+ s) O
| accounts_login_record |
% k. r, u) J" d# W: ?1 q9 P| accounts_user_profile |& x- _8 s0 Z4 n
| auth_group |7 h: H9 v q& E$ Z7 E/ x
| auth_group_permissions |
' Z; X% c5 ~% e6 l7 w! ~! R1 Z| auth_permission |1 ^, f2 H, c6 W/ |# C8 b
| auth_user |
7 B, i9 `7 Y1 O E| auth_user_groups |. t- g9 q( ?. R/ f, f
| auth_user_user_permissions |
! X9 f% E3 z; @| django_admin_log |
* \( u8 A m( C7 F# t- c1 O| django_content_type |2 X, ]2 g6 e. J' n
| django_migrations |
) T7 q: P0 d0 p0 s6 L- K| django_session |4 t: ]$ v% O! o/ C
| sight |+ L/ a3 B- B. I
| sight_comment |
) j7 {! ]4 L6 A" V% X' `| sight_info |& X( r+ U4 P) c
| sight_ticket |6 A, U4 x* f% t. x5 G7 }
| system_image_related |
) C3 E9 N* u! {* b| system_slider |
6 u/ D& d# K- _% w* u+-------------------------------+
/ \1 `5 P r, w! j3 o21 rows in set (0.002 sec)) N0 ?- M" U! T6 i" _ \
2 @% l' i3 d4 g4 O. K, u" s2 r4 w8 A
& Y+ w( R8 u2 BMariaDB [tripsql]> delete from django_migrations where app='order';) I3 _; x: j1 |2 o) t
Query OK, 2 rows affected (0.004 sec)
+ `0 H! ?( D, ?4 Z* p2 B7 v- f- t* X' s
MariaDB [tripsql]> exit
& f1 @! s. u& Z, z5 k# x9 lBye6 O$ p* @* \2 ?
9 j; Z. R9 e- G/ C) I/ O(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order
+ ~. i) L5 N$ n! aOperations to perform:
* S# F) B$ g9 X0 Z# B Apply all migrations: order
$ E% z3 k, s t5 B4 s/ X7 q- [4 F! R! Z) GRunning migrations:
7 v6 _0 g" K& O+ b Applying order.0001_initial... OK# C& p/ L' }; [
; N' P. M! m, o+ v) z: ]( q
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip># M+ @) C9 U0 Q8 t$ n
这次成功同步过去了。
- ]$ C9 h1 v$ y' z+ v2 H2 Q0 i3 u& G# e
+ I5 v, F3 X; T7 x& L) A
+ I6 d0 W# j/ }' m! Q6 e
E1 k7 W7 i I& F% z. O. {% X7 a5 ]8 c6 u' @# a8 T
) s6 ?- a1 w1 Z% S. D: \0 u9 V7 m5 _) C& X# ~
! y9 I2 E4 } a- q, s
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero
* c5 x2 o* H3 F) k. ]7 ~; B: Q/ xOperations to perform:
9 g2 @* P6 e8 w! C6 _4 d Unapply all migrations: order1 G+ ^4 q' R& X6 ]8 `$ q: j% s
Running migrations:
# f2 I& x2 a6 ~: N( \- b Rendering model states... DONE$ _& T5 F2 ?; n: a Y" \
Unapplying order.0001_initial... OK/ F0 \. t1 B% T. i& _8 R! G$ N6 c$ A
8 r+ Q( v3 {0 Y6 C0 z
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero+ G+ r5 B- c9 P) H
Operations to perform:9 ~, C" @( _" h1 I9 M; {- B' }: \ w
Unapply all migrations: order
7 i6 P* {3 g. d9 [3 nRunning migrations:/ t' L, W- `8 R4 j8 G/ h
No migrations to apply.1 I: f# i% C, b" [- e* R3 B
2 w8 G; D9 k% h$ f2 q/ E: G( j0 o, L8 H
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations --empty order2 b5 R+ W! g4 V5 X' l9 ?
Migrations for 'order':) s! E# f; {( {! A# M
order\migrations\0002_auto_20250718_1752.py% \4 f7 ^4 Y* r) G) x" L8 Z1 |. |
, r# @5 S+ P2 z# Q(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell+ D1 |! P1 z' C5 i
Welcome to the MariaDB monitor. Commands end with ; or \g.$ d" A; \4 F$ _) o0 ]
Your MariaDB connection id is 162/ E2 `- I' W2 ^" l% p% P" B! J9 L6 G
Server version: 11.5.1-MariaDB mariadb.org binary distribution
9 A: `1 g) ]$ G* D O6 d& l6 J
/ @. K4 `" J9 \4 ECopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
I4 O( B9 U! j7 X! t& `
) E) C4 D+ p: m2 I7 W% t' FType 'help;' or '\h' for help. Type '\c' to clear the current input statement.& J- G" |% W; o, G
# q6 l7 Y( Y$ `+ h- ?6 Y+ E
MariaDB [tripsql]> delete from django_migrations where app='order';# _# s( l" A- F6 K+ v3 b# F$ n+ }7 ~
Query OK, 0 rows affected (0.001 sec)7 I; ~5 ]3 o/ d3 H; t5 Z* _* T
3 ^- T$ H: e- o" U. Z( I# _MariaDB [tripsql]>3 J# |% g* Y8 |
8 H( }6 L+ `9 d$ a7 t) u
! c0 i" V1 c3 k3 r, Z x% U2 }
9 [# c0 M2 ]) f2 X4 o J/ D* k& N# m$ k
( h8 Q8 c2 i" v, t7 H5 s8 q
+ V) c* q% e) s) \; M |
|