feat(legacy): move session store to database (#2523)
This commit is contained in:
parent
be282fac80
commit
001466f8fd
14 changed files with 2259 additions and 5 deletions
|
@ -0,0 +1,34 @@
|
|||
# pylint: disable=invalid-name
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
from ._migrations import legacy_migration_factory
|
||||
|
||||
UP = """
|
||||
CREATE TABLE "sessions"
|
||||
(
|
||||
"id" CHAR(32) NOT NULL,
|
||||
"modified" INTEGER,
|
||||
"lifetime" INTEGER,
|
||||
"data" TEXT,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
"""
|
||||
|
||||
DOWN = """
|
||||
DROP TABLE IF EXISTS "sessions" CASCADE;
|
||||
"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("legacy", "0044_add_track_types_analyzer_options"),
|
||||
]
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=legacy_migration_factory(
|
||||
target="45",
|
||||
sql=UP,
|
||||
)
|
||||
)
|
||||
]
|
|
@ -1,2 +1,2 @@
|
|||
# The schema version is defined using the migration file prefix number
|
||||
LEGACY_SCHEMA_VERSION = "44"
|
||||
LEGACY_SCHEMA_VERSION = "45"
|
||||
|
|
|
@ -686,6 +686,21 @@ CREATE TABLE "podcast_episodes"
|
|||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- sessions
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS "sessions" CASCADE;
|
||||
|
||||
CREATE TABLE "sessions"
|
||||
(
|
||||
"id" CHAR(32) NOT NULL,
|
||||
"modified" INTEGER,
|
||||
"lifetime" INTEGER,
|
||||
"data" TEXT,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_owner_fkey"
|
||||
FOREIGN KEY ("owner_id")
|
||||
REFERENCES "cc_subjs" ("id");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue