|
|
因调试过程中,发现有点问题,就把数据库表从其他客户端删除了,以为删除了就可以同步过去,没想到就是下面的结果。! G. [3 \4 U: i5 |; _
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py check
& G' |- y t. E5 q# BSystem check identified no issues (0 silenced).% c: ^: N- }( O9 N' y9 Q
2 ^# T- s/ b+ y4 R( P4 F
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations
& Q7 |( K" @" i' n$ D# V6 pNo changes detected
: _: p7 _8 E3 K k
* H/ ], k1 p3 Q6 U! V2 N( C(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations order
8 I$ U2 b8 Y" Y9 b/ ZNo changes detected in app 'order'
+ X1 d0 V$ R* {$ V' O5 w9 U' X- x" N) }# w4 N3 V% I
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order
( e J2 V& `; aOperations to perform:
) @$ q; y O# L0 G* I; q Apply all migrations: order8 j1 Y+ E% Y( U% |: `) {
Running migrations:2 t3 y9 M: [! ?
No migrations to apply.
4 L8 x9 m% K6 l2 a4 B& m
6 e$ n" h" A) { u同步不过去,怎么办?+ B7 }, R- W# A
看到有高手的同步经历,按照他的方法,去执行了下,好像问题解决了。
7 F) t( S. [3 G( d' R2 ~6 J% w% `2 {" `7 D: f* ^
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell- m/ i1 P) \# j5 b3 i# x4 H1 M
Welcome to the MariaDB monitor. Commands end with ; or \g.+ x/ `1 y. C8 L
Your MariaDB connection id is 1526 h2 h& n; D. I) }
Server version: 11.5.1-MariaDB mariadb.org binary distribution
+ D2 l8 |" y( }
5 J d6 F8 r6 v1 |Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
# I& G. A/ t/ d; G
, R v- s$ {# [Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.3 b* |6 j# e# u# g! c
1 A4 X" G0 j- c+ D5 u S" A4 R& e8 A
MariaDB [tripsql]> show tables;) ]- }) f- m' j
+-------------------------------+- z% s9 o; \# L2 G* P
| Tables_in_tripsql |- [0 Z8 I) l+ d. Z/ T9 o! _9 G
+-------------------------------+
) `3 q" `2 a0 F$ S: M! X# L; ]| account_user |9 a( K1 e- T2 Z
| account_user_groups |0 | r& }" @$ d8 r
| account_user_user_permissions |
" ]% e6 Y- D1 e! b- f! V| accounts_login_record |6 A& ?& U9 g9 j/ n& m% f4 K0 b$ q
| accounts_user_profile |" V; Q m& S2 I) r, x1 a
| auth_group |
7 u" q. r$ |* || auth_group_permissions |
4 ]! U! [1 G0 Q; I7 N3 W| auth_permission |
: a [, n4 a, z( A! v4 l" T| auth_user |
: D1 x5 j8 v4 Q8 f* c K| auth_user_groups |
1 j+ |; k. h. b; Y" W8 S) K9 b| auth_user_user_permissions |9 `( q0 S# n3 P3 P7 T6 v
| django_admin_log |) v7 P! H+ Y+ E M& `/ g+ [
| django_content_type |
) \1 P" o, X0 U| django_migrations |2 c1 s. ]$ \; {% [0 W2 \% b
| django_session |' _, u; v2 U" ?" Z! f
| sight |
9 `9 F2 D( N; o* [, O: P( h- i| sight_comment |$ f: _; [6 X+ N Y; R
| sight_info |
6 {1 j! N) J7 J0 ^4 c7 V| sight_ticket |
" g: J' S5 z. g$ o/ j/ {+ j| system_image_related |: q7 {& _! ]" V# ~2 R2 B
| system_slider |' h; M$ h8 p8 @2 J# b
+-------------------------------+
9 M+ l8 g+ u' ?. l& l21 rows in set (0.002 sec)
1 J* q, { z1 ^, m: k( J, S- S) j
: s- i; q0 e% Z6 y- [- b' AMariaDB [tripsql]> delete from django_migrations where app='order';
. [) t" n% v/ |Query OK, 2 rows affected (0.004 sec)2 R2 f% t+ Z$ q3 S: G/ P( m
1 F/ d, \0 I" F3 g8 E3 p
MariaDB [tripsql]> exit
# x7 q9 T }( H8 O' ^( _# `) RBye
; K/ d1 q- \ {
7 A0 T/ E% K: t& `7 N(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order5 X; Q' G% L& d) o
Operations to perform:4 u; ^( L! M& U8 { {
Apply all migrations: order
% W: j& f T) L) Z8 vRunning migrations:
5 z( H; g$ z) y: c( n Applying order.0001_initial... OK
2 Z4 D; T9 K7 D# T8 {$ @( a8 H* Q9 p% I- C5 E$ E
(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip> \/ m: d) T* D% E3 C
这次成功同步过去了。 e s+ j& X* `3 w z
# L x0 V% Z: e( s6 I. {7 h ^7 K! i
- W8 i, }- s, G1 Q$ j& o
2 w1 Q5 j B2 Z% R! h( J3 ?3 S! i; p2 u
+ {" U/ `( U F! K) Z# |
x) D# f; \% e+ q8 M* ~, F! S& k$ `) s& u5 K$ K: G3 h
2 N3 S4 c2 U, w6 C! v(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero# x) v& T, Y4 h4 c! y* {
Operations to perform:
# L/ @ o O# K1 ?- A8 c- H Unapply all migrations: order
: c& ?9 k/ m4 y+ oRunning migrations:
; i; [! [. K9 g6 l) ]1 L- d0 P Rendering model states... DONE
) B' ?2 t' y" l& ?$ d1 j Unapplying order.0001_initial... OK
" b7 u' u& h: n" P& m
$ ?8 ]) w0 y9 G; v: d( K! \(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py migrate order zero
q! w. ~" x. h2 |2 ]9 A0 Z" mOperations to perform:: z6 d" k4 B5 B- \+ \* f/ D
Unapply all migrations: order; {0 a+ n. Y1 D6 ^2 J
Running migrations:: c2 S, A* q& O. ]& {' w: Y
No migrations to apply./ {$ C& Z# @+ K4 p9 { }0 v' d3 _* N
& X, M/ K( H+ s ^9 f( l* o( k. I(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py makemigrations --empty order. }6 `+ B$ p6 D" y6 ^
Migrations for 'order':" l( q% L, ]; W9 ?% C4 S, H+ M
order\migrations\0002_auto_20250718_1752.py o' f/ k, T% A b$ H
- N$ w; [/ ~, G) @" K- W(python3.8.2-vitual) C:\Users\admin\Desktop\deskdirectory\trip>python manage.py dbshell7 [. O# A& t; B x ?7 d
Welcome to the MariaDB monitor. Commands end with ; or \g.$ P6 I" O; c9 y$ s) J
Your MariaDB connection id is 162
& \* U0 p1 N2 D2 _Server version: 11.5.1-MariaDB mariadb.org binary distribution+ [( `% ^" l% W( u; \
2 r7 x6 D& }7 c+ I( eCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
- r/ X- d& L! H! x8 g6 b4 F$ I* l) v& L) N
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
8 I2 J' O8 g$ F- C) N; ]6 t" i8 U$ ^$ z9 R" y l. Z
MariaDB [tripsql]> delete from django_migrations where app='order';
6 n0 _0 m0 R! x% tQuery OK, 0 rows affected (0.001 sec)
+ k$ Z' `7 d: O+ S1 e8 o1 B$ V+ l
MariaDB [tripsql]>
) h) W8 R: V+ a& }. o. D; B! [, F; J! X. G& U* C6 Z
+ k# Z) o+ E' \) }2 c0 C
5 O( n* u+ ^) ~
% k: T3 O3 D. Y, K, T, S8 H. _) ?9 v% P0 p: `% x$ s
8 \9 c' B4 E+ ~ [! s5 c |
|