FengoShujic / feng-shui-app

0 stars 0 forks source link

PROBLEM kod docker-compose up: "core_task" does not exist #9

Open FengoShujic opened 3 months ago

FengoShujic commented 3 months ago

Gledajući migracije i odgovor na podizanje baze preko dokera vidi se da u core-u kod 0001_initial.py prekidaju dalje migracije i da se navodno core_task tabela tu ne kreira, a trebalo bi.

SHOW MIGRATIONS:

PS C:\Users\zarko\Desktop\Programiranje\FengShui\Backend\feng-shui-app> docker-compose run --rm app sh -c "python manage.py showmigrations" time="2024-07-17T16:32:37+02:00" level=warning msg="C:\Users\zarko\Desktop\Programiranje\FengShui\Backend\feng-shui-app\docker-compose.yml: version is obsolete" [+] Creating 1/0 ✔ Container feng-shui-app-db-1 Running 0.0s admin [X] 0001_initial [X] 0002_logentry_remove_auto_add [X] 0003_logentry_add_action_flag_choices auth [X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length [X] 0010_alter_group_name_max_length [X] 0011_update_proxy_permissions [X] 0012_alter_user_first_name_max_length authtoken [X] 0001_initial [X] 0002_auto_20160226_1747 [X] 0003_tokenproxy contenttypes [X] 0001_initial [X] 0002_remove_content_type_name core [X] 0001_initial [ ] 0002_alter_task_project [ ] 0003_alter_task_project_alter_task_sub_project [ ] 0004_remove_subtask_parent_subtask_created_at_and_more [ ] 0005_tag [ ] 0006_subtask_tag_task_tag [ ] 0007_rename_tag_subtask_tags_rename_tag_task_tags [ ] 0008_comment [ ] 0009_alter_task_options_task_position [ ] 0010_subtask_end_date_task_end_date sessions [X] 0001_initial

DOCKER-COMPOSE BUILD je OK

DOCKER-COMPOSE UP:

PS C:\Users\zarko\Desktop\Programiranje\FengShui\Backend\feng-shui-app> docker-compose up
time="2024-07-17T15:27:28+02:00" level=warning msg="C:\Users\zarko\Desktop\Programiranje\FengShui\Backend\feng-shui-app\docker-compose.yml: version is obsolete" [+] Running 2/0 ✔ Container feng-shui-app-db-1 Created 0.0s ✔ Container feng-shui-app-app-1 Created 0.0s Attaching to app-1, db-1 db-1 | db-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization db-1 |
db-1 | 2024-07-17 13:27:29.219 UTC [1] LOG: starting PostgreSQL 13.13 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit db-1 | 2024-07-17 13:27:29.219 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 db-1 | 2024-07-17 13:27:29.219 UTC [1] LOG: listening on IPv6 address "::", port 5432
db-1 | 2024-07-17 13:27:29.224 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db-1 | 2024-07-17 13:27:29.235 UTC [22] LOG: database system was shut down at 2024-07-17 13:20:38 UTC db-1 | 2024-07-17 13:27:29.255 UTC [1] LOG: database system is ready to accept connections
app-1 | waiting for db...
app-1 | Database Available! app-1 | Operations to perform:
app-1 | Apply all migrations: admin, auth, authtoken, contenttypes, core, sessions app-1 | Running migrations:
db-1 | 2024-07-17 13:27:32.234 UTC [29] ERROR: relation "core_task" does not exist
db-1 | 2024-07-17 13:27:32.234 UTC [29] STATEMENT: ALTER TABLE "core_task" ALTER COLUMN "project_id" DROP NOT NULL
app-1 | Traceback (most recent call last):
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/utils.py", line 87, in _execute app-1 | return self.cursor.execute(sql) app-1 | psycopg2.errors.UndefinedTable: relation "core_task" does not exist
app-1 |
app-1 |
app-1 | The above exception was the direct cause of the following exception: app-1 |
app-1 | Traceback (most recent call last):
app-1 | File "/app/manage.py", line 22, in
app-1 | main() app-1 | File "/app/manage.py", line 18, in main
app-1 | execute_from_command_line(sys.argv)
app-1 | File "/py/lib/python3.9/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
app-1 | utility.execute()
app-1 | File "/py/lib/python3.9/site-packages/django/core/management/init.py", line 436, in execute
app-1 | self.fetch_command(subcommand).run_from_argv(self.argv)
app-1 | File "/py/lib/python3.9/site-packages/django/core/management/base.py", line 412, in run_from_argv app-1 | self.execute(*args, cmd_options)
app-1 | File "/py/lib/python3.9/site-packages/django/core/management/base.py", line 458, in execute
app-1 | output = self.handle(*args, *options)
app-1 | File "/py/lib/python3.9/site-packages/django/core/management/base.py", line 106, in wrapper
app-1 | res = handle_func(
args,
kwargs)
app-1 | File "/py/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 356, in handle app-1 | post_migrate_state = executor.migrate(
app-1 | File "/py/lib/python3.9/site-packages/django/db/migrations/executor.py", line 135, in migrate
app-1 | state = self._migrate_all_forwards(
app-1 | File "/py/lib/python3.9/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
app-1 | state = self.apply_migration(
app-1 | File "/py/lib/python3.9/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
app-1 | state = migration.apply(state, schema_editor) app-1 | File "/py/lib/python3.9/site-packages/django/db/migrations/migration.py", line 132, in apply app-1 | operation.database_forwards(
app-1 | File "/py/lib/python3.9/site-packages/django/db/migrations/operations/fields.py", line 235, in database_forwards
app-1 | schema_editor.alter_field(from_model, from_field, to_field)
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 831, in alter_field
app-1 | self._alter_field(
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/postgresql/schema.py", line 288, in _alter_field
app-1 | super()._alter_field( app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 1056, in _alter_field
app-1 | self.execute(
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/postgresql/schema.py", line 48, in execute
app-1 | return super().execute(sql, None)
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 201, in execute app-1 | cursor.execute(sql, params)
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/utils.py", line 102, in execute
app-1 | return super().execute(sql, params)
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/utils.py", line 67, in execute
app-1 | return self._execute_with_wrappers(
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
app-1 | return executor(sql, params, many, context)
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute app-1 | return self.cursor.execute(sql, params)
app-1 | File "/py/lib/python3.9/site-packages/django/db/utils.py", line 91, in exit
app-1 | raise dj_exc_value.with_traceback(traceback) from exc_value
app-1 | File "/py/lib/python3.9/site-packages/django/db/backends/utils.py", line 87, in _execute
app-1 | return self.cursor.execute(sql)
app-1 | django.db.utils.ProgrammingError: relation "core_task" does not exist
app-1 | django.db.utils.ProgrammingError: relation "core_task" does not exist
app-1 | app-1 | Applying core.0002_alter_task_project... app-1 exited with code 1