본문 바로가기

Development (Python, Django, C..)

[Django] Migration 파일 제거

 

- Migration directory 내 파일 삭제

(DJENV) # find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
(DJENV) # find . -path "*/migrations/*.pyc" -delete

 

- DB 제거

MariaDB [PerfONEw]> drop database PerfONEw;
Query OK, 17 rows affected (0.23 sec)

MariaDB [(none)]> create database PerfONEw;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]>

 

- 초기 migration 수행

(DJENV) # python manage.py makemigrations
Migrations for 'analyze':
  analyze/migrations/0001_initial.py
    - Create model System_master
    - Create model Upload_master
    - Create model Upload_files
    - Create model Analyze_stat
Migrations for 'view':
  view/migrations/0001_initial.py
    - Create model logData
    - Create model traceFile

(DJENV) # python manage.py migrate
Operations to perform:
  Apply all migrations: admin, analyze, auth, contenttypes, sessions, view
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying analyze.0001_initial... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying auth.0012_alter_user_first_name_max_length... OK
  Applying sessions.0001_initial... OK
  Applying view.0001_initial... OK

 

- Super user 생성

(DJENV) # python manage.py createsuperuser
Username (leave blank to use 'root'): 
Email address: root@comp.com
Password: 
Password (again): 
The password is too similar to the username.
This password is too short. It must contain at least 8 characters.
This password is too common.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.
(DJENV) #