Replies: 2 comments 2 replies
-
|
Same. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Any news? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
tldr;
When I run
alembic revision --autogenerate -m "checking if migration is uptodate"
on branch that is derived from main it creates new strange migration that drops many tables so it looks like the migration is broken
See related issue: #9853
Questions
❯ cd backend
❯ ls data/webui.db
data/webui.db
❯ export DATABASE_URL=sqlite:///data/webui.db
❯ alembic history
FAILED: No config file 'alembic.ini' found, or file has no '[alembic]' section
❯ cd open_webui
❯ export DATABASE_URL=sqlite:///../data/webui.db
❯ export PYTHONPATH=$VIRTUAL_ENV/bin:$VIRTUAL_ENV/bin:.:../
❯ alembic revision --autogenerate -m "checking if migration is uptodate"
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.autogenerate.compare] Detected removed index 'chatidtag_id' on 'chatidtag'
INFO [alembic.autogenerate.compare] Detected removed table 'chatidtag'
INFO [alembic.autogenerate.compare] Detected removed table 'knowledge'
INFO [alembic.autogenerate.compare] Detected removed index 'document_collection_name' on 'document'
INFO [alembic.autogenerate.compare] Detected removed index 'document_name' on 'document'
INFO [alembic.autogenerate.compare] Detected removed table 'document'
INFO [alembic.autogenerate.compare] Detected removed index 'tool_id' on 'tool'
INFO [alembic.autogenerate.compare] Detected removed table 'tool'
INFO [alembic.autogenerate.compare] Detected removed table 'feedback'
INFO [alembic.autogenerate.compare] Detected removed table 'message_reaction'
INFO [alembic.autogenerate.compare] Detected removed table 'folder'
INFO [alembic.autogenerate.compare] Detected removed index 'memory_id' on 'memory'
INFO [alembic.autogenerate.compare] Detected removed table 'memory'
INFO [alembic.autogenerate.compare] Detected removed table 'channel'
INFO [alembic.autogenerate.compare] Detected removed table 'channel_member'
INFO [alembic.autogenerate.compare] Detected removed table 'message'
INFO [alembic.autogenerate.compare] Detected removed table 'config'
INFO [alembic.autogenerate.compare] Detected removed index 'function_id' on 'function'
INFO [alembic.autogenerate.compare] Detected removed table 'function'
INFO [alembic.autogenerate.compare] Detected removed index 'model_id' on 'model'
INFO [alembic.autogenerate.compare] Detected removed table 'model'
INFO [alembic.autogenerate.compare] Detected removed index 'prompt_command' on 'prompt'
INFO [alembic.autogenerate.compare] Detected removed table 'prompt'
INFO [alembic.autogenerate.compare] Detected removed table 'migratehistory'
INFO [alembic.autogenerate.compare] Detected NULL on column 'auth.email'
INFO [alembic.autogenerate.compare] Detected NULL on column 'auth.password'
INFO [alembic.autogenerate.compare] Detected NULL on column 'auth.active'
INFO [alembic.autogenerate.compare] Detected type change from INTEGER() to Boolean() on 'auth.active'
INFO [alembic.autogenerate.compare] Detected removed index 'auth_id' on 'auth'
INFO [alembic.autogenerate.compare] Detected NULL on column 'chat.user_id'
INFO [alembic.autogenerate.compare] Detected NULL on column 'chat.title'
INFO [alembic.autogenerate.compare] Detected NULL on column 'chat.created_at'
INFO [alembic.autogenerate.compare] Detected type change from DATETIME() to BigInteger() on 'chat.created_at'
INFO [alembic.autogenerate.compare] Detected NULL on column 'chat.updated_at'
INFO [alembic.autogenerate.compare] Detected type change from DATETIME() to BigInteger() on 'chat.updated_at'
INFO [alembic.autogenerate.compare] Detected type change from VARCHAR(length=255) to Text() on 'chat.share_id'
INFO [alembic.autogenerate.compare] Detected NULL on column 'chat.archived'
INFO [alembic.autogenerate.compare] Detected type change from INTEGER() to Boolean() on 'chat.archived'
INFO [alembic.autogenerate.compare] Detected NULL on column 'chat.meta'
INFO [alembic.autogenerate.compare] Detected removed index 'chat_id' on 'chat'
INFO [alembic.autogenerate.compare] Detected removed index 'chat_share_id' on 'chat'
INFO [alembic.autogenerate.compare] Detected added unique constraint None on '('share_id',)'
INFO [alembic.autogenerate.compare] Detected type change from TEXT() to String() on 'file.id'
INFO [alembic.autogenerate.compare] Detected NULL on column 'file.user_id'
INFO [alembic.autogenerate.compare] Detected type change from TEXT() to String() on 'file.user_id'
INFO [alembic.autogenerate.compare] Detected NULL on column 'file.filename'
INFO [alembic.autogenerate.compare] Detected NULL on column 'file.created_at'
INFO [alembic.autogenerate.compare] Detected type change from INTEGER() to BigInteger() on 'file.created_at'
INFO [alembic.autogenerate.compare] Detected removed index 'file_id' on 'file'
INFO [alembic.autogenerate.compare] Detected NULL on column 'tag.name'
INFO [alembic.autogenerate.compare] Detected NULL on column 'user.name'
INFO [alembic.autogenerate.compare] Detected NULL on column 'user.email'
INFO [alembic.autogenerate.compare] Detected NULL on column 'user.role'
INFO [alembic.autogenerate.compare] Detected NULL on column 'user.profile_image_url'
INFO [alembic.autogenerate.compare] Detected NULL on column 'user.last_active_at'
INFO [alembic.autogenerate.compare] Detected type change from INTEGER() to BigInteger() on 'user.last_active_at'
INFO [alembic.autogenerate.compare] Detected NULL on column 'user.updated_at'
INFO [alembic.autogenerate.compare] Detected type change from INTEGER() to BigInteger() on 'user.updated_at'
INFO [alembic.autogenerate.compare] Detected NULL on column 'user.created_at'
INFO [alembic.autogenerate.compare] Detected type change from INTEGER() to BigInteger() on 'user.created_at'
INFO [alembic.autogenerate.compare] Detected removed index 'user_api_key' on 'user'
INFO [alembic.autogenerate.compare] Detected removed index 'user_id' on 'user'
INFO [alembic.autogenerate.compare] Detected removed index 'user_oauth_sub' on 'user'
INFO [alembic.autogenerate.compare] Detected added unique constraint None on '('oauth_sub',)'
INFO [alembic.autogenerate.compare] Detected added unique constraint None on '('api_key',)'
Generating ... done
❯ alembic history
-> 7e5b5dc7342b, init...
3781e22d8b01 -> c4b52c5b69a7 (head), checking if migration is uptodate
7826ab40b532 -> 3781e22d8b01, Update message & channel tables
57c599a3cb57 -> 7826ab40b532, Update file table
922e7a387820 -> 57c599a3cb57, Add channel table
4ace53fd72c8 -> 922e7a387820, Add group table
af906e964978 -> 4ace53fd72c8, Update folder table and change DateTime to BigInteger for timestamp fields
c29facfe716b -> af906e964978, Add feedback table
c69f45358db4 -> c29facfe716b, Update file table path
3ab32c4b8f59 -> c69f45358db4, Add folder table
1af9b942657b -> 3ab32c4b8f59, Update tags
242a2047eae0 -> 1af9b942657b, Migrate tags
6a39f3d8e55c -> 242a2047eae0, Update chat table
c0fbf31ca0db -> 6a39f3d8e55c, Add knowledge table
ca81bd47c050 -> c0fbf31ca0db, Update file table
7e5b5dc7342b -> ca81bd47c050, Add config table
❯ alembic revision --autogenerate -m "check again"
...
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
ERROR [alembic.util.messaging] Target database is not up to date.
FAILED: Target database is not up to date.
❯ sqlite3 ../data/webui.db ".tables"
alembic_version config group model
auth document knowledge prompt
channel feedback memory tag
channel_member file message tool
chat folder message_reaction user
chatidtag function migratehistory
need less to say that now the db is non functional.
I tried
❯ export PG_USER=postgres
export PG_PASSWORD=mysecretpassword
export PG_HOST=localhost
export PG_PORT=5432
export PG_DATABASE=postgres
export DATABASE_URL=postgres://${PG_USER}:${PG_PASSWORD}@${PG_HOST}:${PG_PORT}/${PG_DATABASE}
export PYTHONPATH=$VIRTUAL_ENV/bin:$VIRTUAL_ENV/bin:.:../
alembic revision --autogenerate -m "checking postgres update"
same problem ...:-(
Beta Was this translation helpful? Give feedback.
All reactions