Merge branch 'feat/postgres' into main

This commit is contained in:
Robert Sparks 2023-04-10 12:29:37 -05:00
commit a8a5e4321c
No known key found for this signature in database
GPG key ID: 6E2A6A5775F91318
473 changed files with 2310 additions and 18545 deletions

View file

@ -45,13 +45,13 @@
"sqltools.connections": [
// Default connection to dev DB container
{
"name": "Local Dev",
"name": "Local PostgreSQL",
"server": "db",
"port": 3306,
"database": "ietf_utf8",
"port": 5432,
"database": "ietf",
"username": "django",
"password": "RkTkDPFnKpko",
"driver": "MySQL",
"driver": "PostgreSQL",
"askForPassword": false,
"connectionTimeout": 60
}
@ -72,7 +72,7 @@
"ms-playwright.playwright",
"ms-python.python",
"ms-python.vscode-pylance",
"mtxr.sqltools-driver-mysql",
"mtxr.sqltools-driver-pg",
"mtxr.sqltools",
"mutantdino.resourcemonitor",
"oderwat.indent-rainbow",
@ -82,15 +82,15 @@
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 3306],
"forwardPorts": [8000, 5432],
"portsAttributes": {
"3000": {
"label": "Vite",
"onAutoForward": "silent"
},
"3306": {
"label": "MariaDB",
"5432": {
"label": "PostgreSQL",
"onAutoForward": "silent"
},
"8000": {

View file

@ -125,14 +125,7 @@ jobs:
services:
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
volumes:
- mariadb-data:/var/lib/mysql
env:
MYSQL_ROOT_PASSWORD: ietf
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
image: ghcr.io/ietf-tools/datatracker-db-pg:latest
steps:
- uses: actions/checkout@v3
@ -144,7 +137,7 @@ jobs:
- name: Ensure DB is ready
run: |
/usr/local/bin/wait-for db:3306 -- echo "DB ready"
/usr/local/bin/wait-for db:5432 -- echo "DB ready"
- name: Run all tests
shell: bash
@ -160,9 +153,9 @@ jobs:
echo "Running tests..."
if [[ "x${{ github.event.inputs.ignoreLowerCoverage }}" == "xtrue" ]]; then
echo "Lower coverage failures will be ignored."
./ietf/manage.py test --settings=settings_sqlitetest --ignore-lower-coverage
./ietf/manage.py test --settings=settings_postgrestest --ignore-lower-coverage
else
./ietf/manage.py test --settings=settings_sqlitetest
./ietf/manage.py test --settings=settings_postgrestest
fi
coverage xml
@ -234,14 +227,7 @@ jobs:
services:
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
volumes:
- mariadb-data:/var/lib/mysql
env:
MYSQL_ROOT_PASSWORD: ietf
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
image: ghcr.io/ietf-tools/datatracker-db-pg:latest
steps:
- uses: actions/checkout@v3
@ -253,7 +239,7 @@ jobs:
- name: Ensure DB is ready
run: |
/usr/local/bin/wait-for db:3306 -- echo "DB ready"
/usr/local/bin/wait-for db:5432 -- echo "DB ready"
- name: Start Datatracker
run: |

View file

@ -20,14 +20,7 @@ jobs:
services:
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
volumes:
- mariadb-data:/var/lib/mysql
env:
MYSQL_ROOT_PASSWORD: ietf
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
image: ghcr.io/ietf-tools/datatracker-db-pg:latest
steps:
- uses: actions/checkout@v3
@ -39,7 +32,7 @@ jobs:
- name: Ensure DB is ready
run: |
/usr/local/bin/wait-for db:3306 -- echo "DB ready"
/usr/local/bin/wait-for db:5432 -- echo "DB ready"
- name: Run all tests
run: |
@ -53,7 +46,7 @@ jobs:
exit 1
fi
echo "Running tests..."
./ietf/manage.py test --settings=settings_sqlitetest
./ietf/manage.py test --settings=settings_postgrestest
coverage xml
- name: Upload Coverage Results to Codecov
@ -120,14 +113,7 @@ jobs:
services:
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
volumes:
- mariadb-data:/var/lib/mysql
env:
MYSQL_ROOT_PASSWORD: ietf
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
image: ghcr.io/ietf-tools/datatracker-db-pg:latest
steps:
- uses: actions/checkout@v3
@ -139,7 +125,7 @@ jobs:
- name: Ensure DB is ready
run: |
/usr/local/bin/wait-for db:3306 -- echo "DB ready"
/usr/local/bin/wait-for db:5432 -- echo "DB ready"
- name: Start Datatracker
run: |

4
.vscode/tasks.json vendored
View file

@ -48,7 +48,7 @@
"args": [
"${workspaceFolder}/ietf/manage.py",
"test",
"--settings=settings_local_sqlitetest"
"--settings=settings_postgrestest"
],
"group": "test",
"presentation": {
@ -68,7 +68,7 @@
"args": [
"${workspaceFolder}/ietf/manage.py",
"test",
"--settings=settings_local_sqlitetest",
"--settings=settings_postgrestest",
"--pattern=tests_js.py"
],
"group": "test",

View file

@ -9,7 +9,7 @@
[![Python Version](https://img.shields.io/badge/python-3.9-blue?logo=python&logoColor=white)](#prerequisites)
[![Django Version](https://img.shields.io/badge/django-2.x-51be95?logo=django&logoColor=white)](#prerequisites)
[![Node Version](https://img.shields.io/badge/node.js-16.x-green?logo=node.js&logoColor=white)](#prerequisites)
[![MariaDB Version](https://img.shields.io/badge/mariadb-10-blue?logo=mariadb&logoColor=white)](#prerequisites)
[![MariaDB Version](https://img.shields.io/badge/postgres-14-blue?logo=postgresql&logoColor=white)](#prerequisites)
##### The day-to-day front-end to the IETF database for people who work on IETF standards.
@ -202,7 +202,7 @@ before activating a new release.
From a datatracker container, run the command:
```sh
./ietf/manage.py test --settings=settings_local_sqlitetest
./ietf/manage.py test --settings=settings_postgrestest
```
> You can limit the run to specific tests using the `--pattern` argument.

View file

@ -1,45 +0,0 @@
#!/usr/bin/env python
import os
import subprocess
import requests
import sys
import stat
import shutil
basedir = os.path.dirname(os.path.dirname(__file__))
sys.path.append(basedir)
shutil.copyfile(os.path.join(basedir, 'docker/settings_local.py'), os.path.join(basedir, 'settings_local.py'))
from ietf.settings_sqlitetest import * # we don't import from django.conf here, on purpose
for dir in [ AGENDA_PATH, IDSUBMIT_REPOSITORY_PATH, IDSUBMIT_STAGING_PATH,
INTERNET_DRAFT_ARCHIVE_DIR, os.path.dirname(DRAFT_ALIASES_PATH), PHOTOS_DIR,
os.path.dirname(os.path.abspath(TEST_GHOSTDRIVER_LOG_PATH)), ]:
if not os.path.exists(dir):
print("Creating %s" % dir)
os.makedirs(dir)
for path in [ DRAFT_ALIASES_PATH, DRAFT_VIRTUAL_PATH, GROUP_ALIASES_PATH, GROUP_VIRTUAL_PATH, ]:
if not os.path.exists(path):
print("Setting up %s" % path)
dir, fn = os.path.split(path)
url = "https://zinfandel.tools.ietf.org/src/db/tmp/%s" % fn
r = requests.get(url)
if r.status_code == 200:
with open(path, "w") as of:
of.write(r.text)
else:
print("Error %s fetching '%s'" % (r.status_code, url))
path = IDSUBMIT_IDNITS_BINARY
if not os.path.exists(path):
print("Setting up %s" % path)
r = requests.get('https://tools.ietf.org/tools/idnits/idnits')
with open(path, 'w') as idnits:
idnits.write(r.text)
os.chmod(path, 0755)

View file

@ -187,10 +187,10 @@ function handleDesiredRoom () {
if (rm) {
state.currentFloor = fl.id
state.currentRoom = rm.id
state.desiredRoom = null
break
}
}
state.desiredRoom = null
}
}

View file

@ -75,7 +75,7 @@ async function main () {
// Pull latest DB image
console.info('Pulling latest DB docker image...')
const dbImagePullStream = await dock.pull('ghcr.io/ietf-tools/datatracker-db:latest')
const dbImagePullStream = await dock.pull('ghcr.io/ietf-tools/datatracker-db-pg:latest')
await new Promise((resolve, reject) => {
dock.modem.followProgress(dbImagePullStream, (err, res) => err ? reject(err) : resolve(res))
})
@ -172,7 +172,7 @@ async function main () {
// Create DB container
console.info(`Creating DB docker container... [dt-db-${branch}]`)
const dbContainer = await dock.createContainer({
Image: 'ghcr.io/ietf-tools/datatracker-db:latest',
Image: 'ghcr.io/ietf-tools/datatracker-db-pg:latest',
name: `dt-db-${branch}`,
Hostname: `dt-db-${branch}`,
HostConfig: {
@ -247,7 +247,8 @@ async function main () {
Env: [
`LETSENCRYPT_HOST=${hostname}`,
`VIRTUAL_HOST=${hostname}`,
`VIRTUAL_PORT=8000`
`VIRTUAL_PORT=8000`,
`PGHOST=dt-db-${branch}`
],
Labels: {
appversion: `${argv.appversion}` ?? '0.0.0',

View file

@ -8,22 +8,14 @@ ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'HOST': '__DBHOST__',
'PORT': 3306,
'NAME': 'ietf_utf8',
'ENGINE': 'django.db.backends.mysql',
'PORT': 5432,
'NAME': 'ietf',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'django',
'PASSWORD': 'RkTkDPFnKpko',
'OPTIONS': {
'sql_mode': 'STRICT_TRANS_TABLES',
'init_command': 'SET storage_engine=InnoDB; SET names "utf8"',
},
},
}
DATABASE_TEST_OPTIONS = {
'init_command': 'SET storage_engine=InnoDB',
}
SECRET_KEY = "__SECRETKEY__"
CELERY_BROKER_URL = '__MQCONNSTR__'

View file

@ -21,6 +21,12 @@ pip --disable-pip-version-check --no-cache-dir install -r requirements.txt
echo "Creating data directories..."
chmod +x ./app-create-dirs.sh
./app-create-dirs.sh
if [ -n "$PGHOST" ]; then
echo "Altering PG search path..."
psql -U django -h $PGHOST -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
fi
echo "Running Datatracker checks..."
./ietf/manage.py check

View file

@ -20,9 +20,6 @@ DATABASES = {
},
}
DATABASE_TEST_OPTIONS = {
'init_command': 'SET storage_engine=InnoDB',
}
IDSUBMIT_IDNITS_BINARY = "/usr/local/bin/idnits"
IDSUBMIT_REPOSITORY_PATH = "test/id/"

View file

@ -17,17 +17,10 @@ services:
GITHUB_ACTIONS: 'true'
HOME: /github/home
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
image: ghcr.io/ietf-tools/datatracker-db-pg:latest
restart: unless-stopped
volumes:
- mariadb-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: RkTkDPFnKpko
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
CI: 'true'
GITHUB_ACTIONS: 'true'
- postgresdb-data:/var/lib/postgresql/data
volumes:
mariadb-data:
postgresdb-data:

View file

@ -18,3 +18,4 @@ chmod +x ./docker/scripts/app-create-dirs.sh
./docker/scripts/app-create-dirs.sh
echo "Fetching latest coverage results file..."
curl -fsSL https://github.com/ietf-tools/datatracker/releases/download/baseline/coverage.json -o release-coverage.json
psql -U django -h db -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'

View file

@ -8,22 +8,14 @@ ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'HOST': 'db',
'PORT': 3306,
'NAME': 'ietf_utf8',
'ENGINE': 'django.db.backends.mysql',
'PORT': 5432,
'NAME': 'ietf',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'django',
'PASSWORD': 'RkTkDPFnKpko',
'OPTIONS': {
'sql_mode': 'STRICT_TRANS_TABLES',
'init_command': 'SET storage_engine=InnoDB; SET names "utf8"',
},
},
}
DATABASE_TEST_OPTIONS = {
'init_command': 'SET storage_engine=InnoDB',
}
IDSUBMIT_IDNITS_BINARY = "/usr/local/bin/idnits"
IDSUBMIT_REPOSITORY_PATH = "test/id/"
IDSUBMIT_STAGING_PATH = "test/staging/"

View file

@ -26,7 +26,7 @@ services:
# UID: 1001
# GID: 1001
# DATADIR: data
# DJANGO_SETTINGS_MODULE: settings_sqlitetest
# DJANGO_SETTINGS_MODULE: settings_postgrestest
# Uncomment the next line to use a non-root user for all processes.
# user: dev
@ -35,27 +35,13 @@ services:
# (Adding the "ports" property to this file will not forward from a Codespace.)
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
image: ghcr.io/ietf-tools/datatracker-db-pg:latest
# build:
# context: ..
# dockerfile: docker/db.Dockerfile
restart: unless-stopped
volumes:
- mariadb-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: RkTkDPFnKpko
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
command:
- '--character-set-server=utf8'
- '--collation-server=utf8_unicode_ci'
- '--innodb-buffer-pool-size=1G'
- '--innodb-log-buffer-size=128M'
- '--innodb-log-file-size=256M'
- '--innodb-write-io-threads=8'
- '--innodb-flush-log-at-trx-commit=0'
- '--performance-schema=1'
- postgresdb-data:/var/lib/postgresql/data
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
@ -101,5 +87,5 @@ services:
# - .:/workspace
volumes:
mariadb-data:
postgresdb-data:
app-assets:

View file

@ -9,7 +9,13 @@ ARG USER_UID=1000
ARG USER_GID=$USER_UID
COPY docker/scripts/app-setup-debian.sh /tmp/library-scripts/docker-setup-debian.sh
RUN sed -i 's/\r$//' /tmp/library-scripts/docker-setup-debian.sh && chmod +x /tmp/library-scripts/docker-setup-debian.sh
# Add Postgresql Apt Repository to get 14
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y --no-install-recommends postgresql-client-14 pgloader \
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
&& apt-get purge -y imagemagick imagemagick-6-common \
# Install common packages, non-root user

View file

@ -5,7 +5,7 @@ echo "Shutting down any instance still running..."
docker compose down
echo "Removing DB volume..."
PROJNAME=$(basename $PWD)
docker volume rm -f "${PROJNAME}_mariadb-data"
docker volume rm -f "${PROJNAME}_postgresdb-data"
echo "Rebuilding the DB image..."
docker compose pull db
docker compose build --no-cache db

View file

@ -5,24 +5,7 @@ from ietf.settings import * # pyflakes:
ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'HOST': 'db',
'PORT': 3306,
'NAME': 'ietf_utf8',
'ENGINE': 'django.db.backends.mysql',
'USER': 'django',
'PASSWORD': 'RkTkDPFnKpko',
'OPTIONS': {
'sql_mode': 'STRICT_TRANS_TABLES',
'init_command': 'SET storage_engine=InnoDB; SET names "utf8"',
},
},
}
DATABASE_TEST_OPTIONS = {
'init_command': 'SET storage_engine=InnoDB',
}
from ietf.settings_postgresqldb import DATABASES # pyflakes:ignore
IDSUBMIT_IDNITS_BINARY = "/usr/local/bin/idnits"
IDSUBMIT_REPOSITORY_PATH = "test/id/"

View file

@ -1,81 +0,0 @@
# Copyright The IETF Trust 2010-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Standard settings except we use SQLite and skip migrations, this is
# useful for speeding up tests that depend on the test database, try
# for instance:
#
# ./manage.py test --settings=settings_sqlitetest doc.ChangeStateTestCase
#
import os
from ietf.settings import * # pyflakes:ignore
from ietf.settings import TEST_CODE_COVERAGE_CHECKER
import debug # pyflakes:ignore
debug.debug = True
# Workaround to avoid spending minutes stepping through the migrations in
# every test run. The result of this is to use the 'syncdb' way of creating
# the test database instead of doing it through the migrations. Taken from
# https://gist.github.com/NotSqrt/5f3c76cd15e40ef62d09
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return None
MIGRATION_MODULES = DisableMigrations()
DATABASES = {
'default': {
'NAME': 'test.db',
'ENGINE': 'django.db.backends.sqlite3',
},
}
if TEST_CODE_COVERAGE_CHECKER and not TEST_CODE_COVERAGE_CHECKER._started: # pyflakes:ignore
TEST_CODE_COVERAGE_CHECKER.start() # pyflakes:ignore
NOMCOM_PUBLIC_KEYS_DIR=os.path.abspath("tmp-nomcom-public-keys-dir")
# Undo any developer-dependent middleware when running the tests
MIDDLEWARE = [ c for c in MIDDLEWARE if not c in DEV_MIDDLEWARE ] # pyflakes:ignore
TEMPLATES[0]['OPTIONS']['context_processors'] = [ p for p in TEMPLATES[0]['OPTIONS']['context_processors'] if not p in DEV_TEMPLATE_CONTEXT_PROCESSORS ] # pyflakes:ignore
REQUEST_PROFILE_STORE_ANONYMOUS_SESSIONS = False
IDSUBMIT_IDNITS_BINARY = "/usr/local/bin/idnits"
IDSUBMIT_REPOSITORY_PATH = "test/id/"
IDSUBMIT_STAGING_PATH = "test/staging/"
INTERNET_DRAFT_ARCHIVE_DIR = "test/archive/"
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = "test/archive/"
RFC_PATH = "test/rfc/"
AGENDA_PATH = '/assets/www6s/proceedings/'
MEETINGHOST_LOGO_PATH = AGENDA_PATH
USING_DEBUG_EMAIL_SERVER=True
EMAIL_HOST='localhost'
EMAIL_PORT=2025
MEDIA_BASE_DIR = 'test'
MEDIA_ROOT = MEDIA_BASE_DIR + '/media/'
MEDIA_URL = '/media/'
PHOTOS_DIRNAME = 'photo'
PHOTOS_DIR = MEDIA_ROOT + PHOTOS_DIRNAME
DOCUMENT_PATH_PATTERN = '/assets/ietf-ftp/{doc.type_id}/'
SUBMIT_YANG_CATALOG_MODEL_DIR = '/assets/ietf-ftp/yang/catalogmod/'
SUBMIT_YANG_DRAFT_MODEL_DIR = '/assets/ietf-ftp/yang/draftmod/'
SUBMIT_YANG_INVAL_MODEL_DIR = '/assets/ietf-ftp/yang/invalmod/'
SUBMIT_YANG_IANA_MODEL_DIR = '/assets/ietf-ftp/yang/ianamod/'
SUBMIT_YANG_RFC_MODEL_DIR = '/assets/ietf-ftp/yang/rfcmod/'
DE_GFM_BINARY = '/usr/local/bin/de-gfm'

View file

@ -0,0 +1,14 @@
DATABASES = {
'default': {
'HOST': 'db',
'PORT': 3306,
'NAME': 'ietf_utf8',
'ENGINE': 'django.db.backends.mysql',
'USER': 'django',
'PASSWORD': 'RkTkDPFnKpko',
'OPTIONS': {
'sql_mode': 'STRICT_TRANS_TABLES',
'init_command': 'SET storage_engine=InnoDB; SET names "utf8"',
},
},
}

View file

@ -0,0 +1,10 @@
DATABASES = {
'default': {
'HOST': 'db',
'PORT': 5432,
'NAME': 'ietf',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'django',
'PASSWORD': 'RkTkDPFnKpko',
},
}

30
docker/db-pg.Dockerfile Normal file
View file

@ -0,0 +1,30 @@
# =====================
# --- Builder Stage ---
# =====================
FROM postgres:14.5 AS builder
ENV POSTGRES_PASSWORD=hk2j22sfiv
ENV POSTGRES_USER=django
ENV POSTGRES_DB=ietf
ENV POSTGRES_HOST_AUTH_METHOD=trust
ENV PGDATA=/data
COPY docker/scripts/db-load-default-extensions.sh /docker-entrypoint-initdb.d/
COPY docker/scripts/db-pg-import.sh /docker-entrypoint-initdb.d/
COPY ietf.dump /
RUN ["sed", "-i", "s/exec \"$@\"/echo \"skipping...\"/", "/usr/local/bin/docker-entrypoint.sh"]
RUN ["/usr/local/bin/docker-entrypoint.sh", "postgres"]
# ===================
# --- Final Image ---
# ===================
FROM postgres:14.5
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
COPY --from=builder /data $PGDATA
ENV POSTGRES_PASSWORD=hk2j22sfiv
ENV POSTGRES_USER=django
ENV POSTGRES_DB=ietf
ENV POSTGRES_HOST_AUTH_METHOD=trust

View file

@ -14,7 +14,7 @@ services:
- app-assets:/assets
db:
ports:
- '3306'
- '5432'
celery:
volumes:
- .:/workspace

View file

@ -28,10 +28,13 @@ yarn build
yarn legacy:build
# Copy config files if needed
cp $WORKSPACEDIR/docker/configs/settings_mysqldb.py $WORKSPACEDIR/ietf/settings_mysqldb.py
cp $WORKSPACEDIR/docker/configs/settings_postgresqldb.py $WORKSPACEDIR/ietf/settings_postgresqldb.py
if [ ! -f "$WORKSPACEDIR/ietf/settings_local.py" ]; then
echo "Setting up a default settings_local.py ..."
cp $WORKSPACEDIR/docker/configs/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
else
echo "Using existing ietf/settings_local.py file"
if ! cmp -s $WORKSPACEDIR/docker/configs/settings_local.py $WORKSPACEDIR/ietf/settings_local.py; then
@ -51,17 +54,6 @@ else
fi
fi
if [ ! -f "$WORKSPACEDIR/ietf/settings_local_sqlitetest.py" ]; then
echo "Setting up a default settings_local_sqlitetest.py ..."
cp $WORKSPACEDIR/docker/configs/settings_local_sqlitetest.py $WORKSPACEDIR/ietf/settings_local_sqlitetest.py
else
echo "Using existing ietf/settings_local_sqlitetest.py file"
if ! cmp -s $WORKSPACEDIR/docker/configs/settings_local_sqlitetest.py $WORKSPACEDIR/ietf/settings_local_sqlitetest.py; then
echo "NOTE: Differences detected compared to docker/configs/settings_local_sqlitetest.py!"
echo "We'll assume you made these deliberately."
fi
fi
if [ ! -f "$WORKSPACEDIR/ietf/settings_local_vite.py" ]; then
echo "Setting up a default settings_local_vite.py ..."
cp $WORKSPACEDIR/docker/configs/settings_local_vite.py $WORKSPACEDIR/ietf/settings_local_vite.py
@ -73,6 +65,10 @@ else
fi
fi
# Recondition settings to make changing databases easier. (Remember that we may have developers starting with settings_local from earlier work)
python docker/scripts/db-include-fix.py
cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/from ietf.settings_mysqldb import DATABASES/from ietf.settings_postgresqldb import DATABASES/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py
# Create data directories
echo "Creating data directories..."
@ -88,9 +84,12 @@ curl -fsSL https://github.com/ietf-tools/datatracker/releases/download/baseline/
if [ -n "$EDITOR_VSCODE" ]; then
echo "Waiting for DB container to come online ..."
/usr/local/bin/wait-for localhost:3306 -- echo "DB ready"
/usr/local/bin/wait-for db:5432 -- echo "PostgreSQL ready"
fi
# Make sure PG search path is set
psql -U django -h db -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
# Run memcached
echo "Starting memcached..."
@ -105,7 +104,6 @@ echo "Running initial checks..."
/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --fake-initial --settings=settings_local
echo "-----------------------------------------------------------------"
echo "Done!"
echo "-----------------------------------------------------------------"
@ -121,7 +119,7 @@ if [ -z "$EDITOR_VSCODE" ]; then
echo
echo "to start a development instance of the Datatracker."
echo
echo " ietf/manage.py test --settings=settings_sqlitetest"
echo " ietf/manage.py test --settings=settings_postgrestest"
echo
echo "to run all the python tests."
echo

View file

@ -0,0 +1,33 @@
from pathlib import Path
content = Path('/workspace/ietf/settings_local.py').read_text()
newcontent = content.replace(
"""DATABASES = {
'default': {
'HOST': 'db',
'PORT': 3306,
'NAME': 'ietf_utf8',
'ENGINE': 'django.db.backends.mysql',
'USER': 'django',
'PASSWORD': 'RkTkDPFnKpko',
'OPTIONS': {
'sql_mode': 'STRICT_TRANS_TABLES',
'init_command': 'SET storage_engine=InnoDB; SET names "utf8"',
},
},
}""",
"from ietf.settings_postgresqldb import DATABASES",
).replace(
"""DATABASES = {
'default': {
'HOST': 'pgdb',
'PORT': 5432,
'NAME': 'ietf',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'django',
'PASSWORD': 'RkTkDPFnKpko',
},
}""",
"from ietf.settings_postgresqldb import DATABASES",
)
with Path('/workspace/ietf/settings_local.py').open('w') as replacementfile:
replacementfile.write(newcontent)

View file

@ -0,0 +1,10 @@
#!/bin/bash
set -e
# Adding the extension to the default template is needed to allow the test-suite
# to be run on postgres (see ietf.settings_postgrestest). The test runner always
# makes a fresh test database instance, and since we are bypassing the migration
# framework and using a fixture to set the database structure, there's no reaonable
# way to install the extension as part of the test run.
psql -U django -d template1 -v ON_ERROR_STOP=1 -c 'CREATE EXTENSION IF NOT EXISTS citext;'

View file

@ -0,0 +1,11 @@
#!/bin/bash
set -e
echo "Drop dummy ietf DB if it exists..."
dropdb -U django --if-exists ietf
# Extensions and search paths will be loaded from the dump
echo "Import DB dump into ietf..."
pg_restore --clean --if-exists --create -U django -d postgres ietf.dump
echo "Done!"

View file

@ -0,0 +1,152 @@
export DEBIAN_FRONTEND=noninteractive
echo "Fixing permissions..."
chmod -R 777 ./
echo "Ensure all requirements.txt packages are installed..."
pip --disable-pip-version-check --no-cache-dir install -r requirements.txt
echo "Creating data directories..."
chmod +x ./docker/scripts/app-create-dirs.sh
./docker/scripts/app-create-dirs.sh
# Add Postgresql Apt Repository to get 14
echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
# Install pg client and pgloader
apt-get update
apt-get install -y --no-install-recommends postgresql-client-14 pgloader
# Wait for DB containers
echo "Waiting for DB containers to come online..."
/usr/local/bin/wait-for db:3306 -- echo "MariaDB ready"
/usr/local/bin/wait-for pgdb:5432 -- echo "PostgreSQL ready"
# Set up schema and alter search path
psql -U django -h pgdb -d ietf -v ON_ERROR_STOP=1 -c '\x' \
-c 'DROP SCHEMA IF EXISTS ietf_utf8 CASCADE;' \
-c 'CREATE SCHEMA ietf_utf8;' \
-c 'ALTER DATABASE ietf SET search_path=ietf_utf8,public;' \
-c 'ALTER USER django set search_path=ietf_utf8,django,public;' \
-c 'CREATE EXTENSION citext WITH SCHEMA ietf_utf8;'
# Copy settings files
cp ./docker/configs/settings_local.py ./ietf/settings_local.py
cp ./docker/configs/settings_mysqldb.py ./ietf/settings_mysqldb.py
cp ./docker/configs/settings_postgresqldb.py ./ietf/settings_postgresqldb.py
# Switch to PostgreSQL config
#cat ./ietf/settings_local.py | sed 's/from ietf.settings_mysqldb import DATABASES/from ietf.settings_postgresqldb import DATABASES/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py
cat ./ietf/settings_postgresqldb.py | sed "s/'db'/'pgdb'/" > /tmp/settings_postgresqldb.py && mv /tmp/settings_postgresqldb.py ./ietf/settings_postgresqldb.py
# Migrate empty schema into postgres database
/usr/local/bin/python ./ietf/manage.py check --settings=settings_local
/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local
# Now transfer data from mysql to postgres
echo "Transferring migrated database from MySQL to PostgreSQL..."
cat << EOF > transforms.lisp
; transform functions for IETF datatracker conversion
(in-package :pgloader.transforms)
(defun integer-to-interval (dt)
"Convert microseconds to a postgres interval value"
(multiple-value-bind (totsec useconds) (floor (parse-integer dt) 1000000)
(multiple-value-bind (totmin seconds) (floor totsec 60)
(multiple-value-bind (tothours minutes) (floor totmin 60)
(multiple-value-bind (totdays hours) (floor tothours 24)
(multiple-value-bind (totmonths days) (floor totdays 30)
(multiple-value-bind (years months) (floor totmonths 12)
(format nil "~a years ~a months ~a days ~a hours ~a minutes ~a seconds ~a microseconds"
years months days hours minutes seconds useconds))))))))
EOF
cat << EOF > cast.load
LOAD DATABASE
FROM mysql://django:RkTkDPFnKpko@db/ietf_utf8
INTO postgresql://django:RkTkDPFnKpko@pgdb/ietf
WITH workers = 3, concurrency = 1, batch size = 1MB, batch rows = 1000,
data only, truncate, include no drop, create no tables, create no indexes, reset sequences
EXCLUDING TABLE NAMES MATCHING
'django_migrations',
'community_communitylist_added_ids',
'community_documentchangedates',
'community_expectedchange',
'community_listnotification',
'community_rule_cached_ids',
'draft_versions_mirror',
'iesg_wgaction',
'ietfworkflows_annotationtag',
'ietfworkflows_statedescription',
'ietfworkflows_stream',
'ietfworkflows_wgworkflow',
'ipr_iprselecttype',
'ipr_iprlicensing',
'request_profiler_profilingrecord',
'request_profiler_ruleset',
'south_migrationhistory',
'submit_idapproveddetail',
'workflows_state',
'workflows_state_transitions',
'workflows_transition',
'workflows_workflow'
CAST TYPE int with extra auto_increment TO integer,
TYPE int TO integer,
COLUMN django_admin_log.action_flag TO smallint,
COLUMN meeting_session_materials.order TO smallint,
COLUMN community_emailsubscription.email_id TO text,
COLUMN doc_dochistory.shepherd_id TO text,
COLUMN doc_document.shepherd_id TO text,
COLUMN doc_documentauthor.email_id TO text,
COLUMN doc_dochistoryauthor.email_id TO text,
COLUMN group_role.email_id TO text,
COLUMN group_rolehistory.email_id TO text,
COLUMN liaisons_liaisonstatement.from_contact_id TO text,
COLUMN nomcom_nominee.email_id TO text,
COLUMN person_email.address TO text,
COLUMN person_historicalemail.address TO text,
COLUMN review_historicalreviewassignment.reviewer_id TO text,
COLUMN review_reviewassignment.reviewer_id TO text,
COLUMN meeting_session.requested_duration TO interval USING integer-to-interval,
COLUMN meeting_timeslot.duration TO interval USING integer-to-interval,
COLUMN meeting_meeting.idsubmit_cutoff_time_utc TO interval USING integer-to-interval,
COLUMN meeting_meeting.idsubmit_cutoff_warning_days TO interval USING integer-to-interval
BEFORE LOAD DO
-- must change person_email before any tables with FK constraints to address
\$\$ ALTER TABLE person_email ALTER COLUMN address TYPE text; \$\$,
\$\$ ALTER TABLE community_emailsubscription ALTER COLUMN email_id TYPE text; \$\$,
\$\$ ALTER TABLE doc_dochistory ALTER COLUMN shepherd_id TYPE text; \$\$,
\$\$ ALTER TABLE doc_document ALTER COLUMN shepherd_id TYPE text; \$\$,
\$\$ ALTER TABLE doc_documentauthor ALTER COLUMN email_id TYPE text; \$\$,
\$\$ ALTER TABLE doc_dochistoryauthor ALTER COLUMN email_id TYPE text; \$\$,
\$\$ ALTER TABLE group_role ALTER COLUMN email_id TYPE text; \$\$,
\$\$ ALTER TABLE group_rolehistory ALTER COLUMN email_id TYPE text; \$\$,
\$\$ ALTER TABLE liaisons_liaisonstatement ALTER COLUMN from_contact_id TYPE text; \$\$,
\$\$ ALTER TABLE nomcom_nominee ALTER COLUMN email_id TYPE text; \$\$,
\$\$ ALTER TABLE person_historicalemail ALTER COLUMN address TYPE text; \$\$,
\$\$ ALTER TABLE review_historicalreviewassignment ALTER COLUMN reviewer_id TYPE text; \$\$,
\$\$ ALTER TABLE review_reviewassignment ALTER COLUMN reviewer_id TYPE text; \$\$
AFTER LOAD DO
\$\$ ALTER TABLE community_emailsubscription ALTER COLUMN email_id TYPE citext; \$\$,
\$\$ ALTER TABLE doc_dochistory ALTER COLUMN shepherd_id TYPE citext; \$\$,
\$\$ ALTER TABLE doc_document ALTER COLUMN shepherd_id TYPE citext; \$\$,
\$\$ ALTER TABLE doc_documentauthor ALTER COLUMN email_id TYPE citext; \$\$,
\$\$ ALTER TABLE doc_dochistoryauthor ALTER COLUMN email_id TYPE citext; \$\$,
\$\$ ALTER TABLE group_role ALTER COLUMN email_id TYPE citext; \$\$,
\$\$ ALTER TABLE group_rolehistory ALTER COLUMN email_id TYPE citext; \$\$,
\$\$ ALTER TABLE liaisons_liaisonstatement ALTER COLUMN from_contact_id TYPE citext; \$\$,
\$\$ ALTER TABLE nomcom_nominee ALTER COLUMN email_id TYPE citext; \$\$,
\$\$ ALTER TABLE person_historicalemail ALTER COLUMN address TYPE citext; \$\$,
\$\$ ALTER TABLE review_historicalreviewassignment ALTER COLUMN reviewer_id TYPE citext; \$\$,
\$\$ ALTER TABLE review_reviewassignment ALTER COLUMN reviewer_id TYPE citext; \$\$,
-- must change person_email after any tables with FK constraints to address
\$\$ ALTER TABLE person_email ALTER COLUMN address TYPE citext; \$\$
;
EOF
pgloader --verbose --logfile=ietf_pgloader.run --summary=ietf_pgloader.summary --load-lisp-file transforms.lisp cast.load
rm cast.load transforms.lisp
# Create export dump
echo "Creating export dump..."
pg_dump -h pgdb -U django -F c ietf > ietf.dump
echo "Done."

3
ietf/.gitignore vendored
View file

@ -2,6 +2,7 @@
/settings_local.py
/settings_local.py.bak
/settings_local_debug.py
/settings_local_sqlitetest.py
/settings_local_vite.py
/settings_mysqldb.py
/settings_postgresqldb.py
/ietfdb.sql.gz

View file

@ -197,7 +197,7 @@ def api_new_meeting_registration(request):
except ValueError as e:
return err(400, "Unexpected POST data: %s" % e)
response = "Accepted, New registration" if created else "Accepted, Updated registration"
if User.objects.filter(username=email).exists() or Email.objects.filter(address=email).exists():
if User.objects.filter(username__iexact=email).exists() or Email.objects.filter(address=email).exists():
pass
else:
send_account_creation_email(request, email)

View file

@ -1,10 +1,6 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from typing import List, Tuple # pyflakes:ignore
# Generated by Django 2.2.28 on 2023-03-20 19:22
from typing import List, Tuple
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
@ -14,8 +10,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
] # type: List[Tuple[str]]
dependencies: List[Tuple[str, str]] = [
]
operations = [
migrations.CreateModel(
@ -35,7 +31,7 @@ class Migration(migrations.Migration):
name='SearchRule',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('rule_type', models.CharField(choices=[('group', 'All I-Ds associated with a particular group'), ('area', 'All I-Ds associated with all groups in a particular Area'), ('group_rfc', 'All RFCs associated with a particular group'), ('area_rfc', 'All RFCs associated with all groups in a particular Area'), ('state_iab', 'All I-Ds that are in a particular IAB state'), ('state_iana', 'All I-Ds that are in a particular IANA state'), ('state_iesg', 'All I-Ds that are in a particular IESG state'), ('state_irtf', 'All I-Ds that are in a particular IRTF state'), ('state_ise', 'All I-Ds that are in a particular ISE state'), ('state_rfceditor', 'All I-Ds that are in a particular RFC Editor state'), ('state_ietf', 'All I-Ds that are in a particular Working Group state'), ('author', 'All I-Ds with a particular author'), ('author_rfc', 'All RFCs with a particular author'), ('ad', 'All I-Ds with a particular responsible AD'), ('shepherd', 'All I-Ds with a particular document shepherd'), ('name_contains', 'All I-Ds with particular text/regular expression in the name')], max_length=30)),
('rule_type', models.CharField(choices=[('group', 'All I-Ds associated with a particular group'), ('area', 'All I-Ds associated with all groups in a particular Area'), ('group_rfc', 'All RFCs associated with a particular group'), ('area_rfc', 'All RFCs associated with all groups in a particular Area'), ('group_exp', 'All expired I-Ds of a particular group'), ('state_iab', 'All I-Ds that are in a particular IAB state'), ('state_iana', 'All I-Ds that are in a particular IANA state'), ('state_iesg', 'All I-Ds that are in a particular IESG state'), ('state_irtf', 'All I-Ds that are in a particular IRTF state'), ('state_ise', 'All I-Ds that are in a particular ISE state'), ('state_rfceditor', 'All I-Ds that are in a particular RFC Editor state'), ('state_ietf', 'All I-Ds that are in a particular Working Group state'), ('author', 'All I-Ds with a particular author'), ('author_rfc', 'All RFCs with a particular author'), ('ad', 'All I-Ds with a particular responsible AD'), ('shepherd', 'All I-Ds with a particular document shepherd'), ('name_contains', 'All I-Ds with particular text/regular expression in the name')], max_length=30)),
('text', models.CharField(blank=True, default='', max_length=255, verbose_name='Text/RegExp')),
('community_list', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.CommunityList')),
],

View file

@ -1,7 +1,4 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
# Generated by Django 2.2.28 on 2023-03-20 19:22
from django.conf import settings
from django.db import migrations, models
@ -14,11 +11,11 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('doc', '0001_initial'),
('group', '0001_initial'),
('person', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('community', '0001_initial'),
('person', '0001_initial'),
('group', '0001_initial'),
('doc', '0001_initial'),
]
operations = [

View file

@ -1,44 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 14:23
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
class Migration(migrations.Migration):
dependencies = [
('community', '0002_auto_20180220_1052'),
]
operations = [
migrations.CreateModel(
name='CommunityListDocs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('communitylist', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.CommunityList')),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id')),
],
),
migrations.AddField(
model_name='communitylist',
name='added_docs2',
field=models.ManyToManyField(related_name='communitylists', through='community.CommunityListDocs', to='doc.Document'),
),
migrations.CreateModel(
name='SearchRuleDocs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id')),
('searchrule', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.SearchRule')),
],
),
migrations.AddField(
model_name='searchrule',
name='name_contains_index2',
field=models.ManyToManyField(related_name='searchrules', through='community.SearchRuleDocs', to='doc.Document'),
),
]

View file

@ -1,56 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 14:27
import sys
from tqdm import tqdm
from django.db import migrations
def forward(apps, schema_editor):
Document = apps.get_model('doc','Document')
CommunityList = apps.get_model('community', 'CommunityList')
CommunityListDocs = apps.get_model('community', 'CommunityListDocs')
SearchRule = apps.get_model('community', 'SearchRule')
SearchRuleDocs = apps.get_model('community', 'SearchRuleDocs')
# Document id fixup ------------------------------------------------------------
objs = Document.objects.in_bulk()
nameid = { o.name: o.id for id, o in objs.items() }
sys.stderr.write('\n')
sys.stderr.write(' %s.%s:\n' % (CommunityList.__name__, 'added_docs'))
count = 0
for l in tqdm(CommunityList.objects.all()):
for d in l.added_docs.all():
count += 1
CommunityListDocs.objects.get_or_create(communitylist=l, document_id=nameid[d.name])
sys.stderr.write(' %s CommunityListDocs objects created\n' % (count, ))
sys.stderr.write(' %s.%s:\n' % (SearchRule.__name__, 'name_contains_index'))
count = 0
for r in tqdm(SearchRule.objects.all()):
for d in r.name_contains_index.all():
count += 1
SearchRuleDocs.objects.get_or_create(searchrule=r, document_id=nameid[d.name])
sys.stderr.write(' %s SearchRuleDocs objects created\n' % (count, ))
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('community', '0003_add_communitylist_docs2_m2m'),
('doc', '0014_set_document_docalias_id'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,32 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-22 08:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('community', '0004_set_document_m2m_keys'),
]
# The implementation of AlterField in Django 1.11 applies
# 'ALTER TABLE <table> MODIFY <field> ...;' in order to fix foregn keys
# to the altered field, but as it seems does _not_ fix up m2m
# intermediary tables in an equivalent manner, so here we remove and
# then recreate the m2m tables so they will have the appropriate field
# types.
operations = [
# Remove fields
migrations.RemoveField(
model_name='communitylist',
name='added_docs',
),
migrations.RemoveField(
model_name='searchrule',
name='name_contains_index',
),
]

View file

@ -1,34 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-22 08:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('community', '0005_1_del_docs_m2m_table'),
]
# The implementation of AlterField in Django 1.11 applies
# 'ALTER TABLE <table> MODIFY <field> ...;' in order to fix foregn keys
# to the altered field, but as it seems does _not_ fix up m2m
# intermediary tables in an equivalent manner, so here we remove and
# then recreate the m2m tables so they will have the appropriate field
# types.
operations = [
# Add fields back (will create the m2m tables with the right field types)
migrations.AddField(
model_name='communitylist',
name='added_docs',
field=models.ManyToManyField(to='doc.Document'),
),
migrations.AddField(
model_name='searchrule',
name='name_contains_index',
field=models.ManyToManyField(to='doc.Document'),
),
]

View file

@ -1,57 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-27 05:56
from django.db import migrations
import sys, time
from tqdm import tqdm
def forward(apps, schema_editor):
CommunityList = apps.get_model('community', 'CommunityList')
CommunityListDocs = apps.get_model('community', 'CommunityListDocs')
SearchRule = apps.get_model('community', 'SearchRule')
SearchRuleDocs = apps.get_model('community', 'SearchRuleDocs')
# Document id fixup ------------------------------------------------------------
sys.stderr.write('\n')
sys.stderr.write(' %s.%s:\n' % (CommunityList.__name__, 'added_docs'))
for l in tqdm(CommunityList.objects.all()):
l.added_docs.set([ d.document for d in CommunityListDocs.objects.filter(communitylist=l) ])
sys.stderr.write(' %s.%s:\n' % (SearchRule.__name__, 'name_contains_index'))
for r in tqdm(SearchRule.objects.all()):
r.name_contains_index.set([ d.document for d in SearchRuleDocs.objects.filter(searchrule=r) ])
def reverse(apps, schema_editor):
pass
def timestamp(apps, schema_editor):
sys.stderr.write('\n %s' % time.strftime('%Y-%m-%d %H:%M:%S'))
class Migration(migrations.Migration):
dependencies = [
('community', '0005_2_add_docs_m2m_table'),
]
operations = [
#migrations.RunPython(forward, reverse),
# Alternative:
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO community_communitylist_added_docs SELECT * FROM community_communitylistdocs;",
""),
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO community_searchrule_name_contains_index SELECT * FROM community_searchruledocs;",
""),
migrations.RunPython(timestamp, timestamp),
]

View file

@ -1,46 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-30 03:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('community', '0006_copy_docs_m2m_table'),
]
operations = [
migrations.RemoveField(
model_name='communitylistdocs',
name='communitylist',
),
migrations.RemoveField(
model_name='communitylistdocs',
name='document',
),
migrations.RemoveField(
model_name='searchruledocs',
name='document',
),
migrations.RemoveField(
model_name='searchruledocs',
name='searchrule',
),
migrations.RemoveField(
model_name='communitylist',
name='added_docs2',
),
migrations.RemoveField(
model_name='searchrule',
name='name_contains_index2',
),
migrations.DeleteModel(
name='CommunityListDocs',
),
migrations.DeleteModel(
name='SearchRuleDocs',
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 2.2.28 on 2022-06-30 05:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('community', '0007_remove_docs2_m2m'),
]
operations = [
migrations.AlterField(
model_name='searchrule',
name='rule_type',
field=models.CharField(choices=[('group', 'All I-Ds associated with a particular group'), ('area', 'All I-Ds associated with all groups in a particular Area'), ('group_rfc', 'All RFCs associated with a particular group'), ('area_rfc', 'All RFCs associated with all groups in a particular Area'), ('group_exp', 'All expired I-Ds of a particular group'), ('state_iab', 'All I-Ds that are in a particular IAB state'), ('state_iana', 'All I-Ds that are in a particular IANA state'), ('state_iesg', 'All I-Ds that are in a particular IESG state'), ('state_irtf', 'All I-Ds that are in a particular IRTF state'), ('state_ise', 'All I-Ds that are in a particular ISE state'), ('state_rfceditor', 'All I-Ds that are in a particular RFC Editor state'), ('state_ietf', 'All I-Ds that are in a particular Working Group state'), ('author', 'All I-Ds with a particular author'), ('author_rfc', 'All RFCs with a particular author'), ('ad', 'All I-Ds with a particular responsible AD'), ('shepherd', 'All I-Ds with a particular document shepherd'), ('name_contains', 'All I-Ds with particular text/regular expression in the name')], max_length=30),
),
]

View file

@ -1,30 +0,0 @@
# Generated by Django 2.2.28 on 2022-06-30 23:15
from django.db import migrations
def forward(apps, schema_editor):
SearchRule = apps.get_model('community', 'SearchRule')
CommunityList = apps.get_model('community', 'CommunityList')
Group = apps.get_model('group', 'Group')
State = apps.get_model('doc', 'State')
for group in Group.objects.filter(type_id__in=['wg','rg'], state_id='active'):
com_list = CommunityList.objects.filter(group=group).first()
if com_list is not None:
SearchRule.objects.create(community_list=com_list, rule_type="group_exp", group=group, state=State.objects.get(slug="expired", type="draft"),)
def reverse(apps, schema_editor):
SearchRule = apps.get_model('community', 'SearchRule')
SearchRule.objects.filter(rule_type='group_exp').delete()
class Migration(migrations.Migration):
dependencies = [
('community', '0008_add_group_exp_rule'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,21 +0,0 @@
# Generated by Django 2.2.28 on 2022-11-05 11:07
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('community', '0009_add_group_exp_rule_to_groups'),
]
operations = [
migrations.RunSQL(
sql="alter table community_communitylist_added_docs modify document_id int unsigned not null;",
reverse_sql="alter table community_communitylist_added_docs modify document_id varchar(255) not null;"
),
migrations.RunSQL(
sql="alter table community_searchrule_name_contains_index modify document_id int unsigned not null;",
reverse_sql="alter table community_searchrule_name_contains_index modify document_id varchar(255) not null;"
),
]

View file

@ -36,7 +36,7 @@ def lookup_community_list(username=None, acronym=None):
group = get_object_or_404(Group, acronym=acronym)
clist = CommunityList.objects.filter(group=group).first() or CommunityList(group=group)
else:
user = get_object_or_404(User, username=username)
user = get_object_or_404(User, username__iexact=username)
clist = CommunityList.objects.filter(user=user).first() or CommunityList(user=user)
return clist

View file

@ -1,10 +1,6 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
from typing import List, Tuple # pyflakes:ignore
# Generated by Django 2.2.28 on 2023-03-20 19:22
from typing import List, Tuple
from django.db import migrations, models
@ -12,8 +8,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
] # type: List[Tuple[str]]
dependencies: List[Tuple[str, str]] = [
]
operations = [
migrations.CreateModel(

View file

@ -1,7 +1,4 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
# Generated by Django 2.2.28 on 2023-03-20 19:22
from django.db import migrations
import django.db.models.deletion
@ -13,9 +10,9 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('dbtemplate', '0001_initial'),
('group', '0001_initial'),
('name', '0001_initial'),
('dbtemplate', '0001_initial'),
]
operations = [

View file

@ -1,119 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-05 11:39
from django.db import migrations
def forward(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate', 'DBTemplate')
DBTemplate.objects.filter(id=186).update(content="""I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please treat these comments just
like any other last call comments.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document: {{ assignment.review_request.doc.name }}-??
Reviewer: {{ assignment.reviewer.person.plain_name }}
Review Date: {{ today }}
IETF LC End Date: {% if assignment.review_request.doc.most_recent_ietflc %}{{ assignment.review_request.doc.most_recent_ietflc.expires|date:"Y-m-d" }}{% else %}None{% endif %}
IESG Telechat date: {{ assignment.review_request.doc.telechat_date|default:'Not scheduled for a telechat' }}
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
""")
DBTemplate.objects.filter(id=187).update(content="""I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please wait for direction from your
document shepherd or AD before posting a new version of the draft.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document: {{ assignment.review_request.doc.name }}-??
Reviewer: {{ assignment.reviewer.person.plain_name }}
Review Date: {{ today }}
IETF LC End Date: {% if assignment.review_req.doc.most_recent_ietflc %}{{ assignment.review_request.doc.most_recent_ietflc.expires|date:"Y-m-d" }}{% else %}None{% endif %}
IESG Telechat date: {{ assignment.review_request.doc.telechat_date|default:'Not scheduled for a telechat' }}
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
""")
def reverse(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
DBTemplate.objects.filter(id=186).update(content="""I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please treat these comments just
like any other last call comments.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document: {{ review_req.doc.name }}-??
Reviewer: {{ review_req.reviewer.person.plain_name }}
Review Date: {{ today }}
IETF LC End Date: {% if review_req.doc.most_recent_ietflc %}{{ review_req.doc.most_recent_ietflc.expires|date:"Y-m-d" }}{% else %}None{% endif %}
IESG Telechat date: {{ review_req.doc.telechat_date|default:'Not scheduled for a telechat' }}
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
""")
DBTemplate.objects.filter(id=187).update(content="""I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please wait for direction from your
document shepherd or AD before posting a new version of the draft.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document: {{ review_req.doc.name }}-??
Reviewer: {{ review_req.reviewer.person.plain_name }}
Review Date: {{ today }}
IETF LC End Date: {% if review_req.doc.most_recent_ietflc %}{{ review_req.doc.most_recent_ietflc.expires|date:"Y-m-d" }}{% else %}None{% endif %}
IESG Telechat date: {{ review_req.doc.telechat_date|default:'Not scheduled for a telechat' }}
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
""")
class Migration(migrations.Migration):
dependencies = [
('dbtemplate', '0002_auto_20180220_1052'),
('doc','0011_reviewassignmentdocevent'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,290 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-13 13:41
from django.db import migrations
def forward(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
DBTemplate.objects.filter(pk=182).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc_id }}-{% if r.review_request..requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request..doc.rev }}{% endif %} {{ r.earlier_review_mark }}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=183).update(content="""{% autoescape off %}Subject: Review Assignments
Hi all,
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer Type LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{r.review_request.type.name|ljust:"10"}}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc_id }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %}{% if r.earlier_review_mark %} {{ r.earlier_review_mark }}{% endif %}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}
The LC and Telechat review templates are included below:
-------------------------------------------------------
-- Begin LC Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please treat these comments just
like any other last call comments.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End LC Template --
-- Begin Telechat Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please wait for direction from your
document shepherd or AD before posting a new version of the draft.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End Telechat Template --
{% endautoescape %}
""")
DBTemplate.objects.filter(pk=184).update(content="""{% autoescape off %}Subject: Assignments
Review instructions and related resources are at:
http://tools.ietf.org/area/sec/trac/wiki/SecDirReview{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }}{{ r.earlier_review|yesno:'R, , ' }}{% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc_id }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %}{% endfor %}
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=185).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
Review instructions and related resources are at:
<https://trac.ietf.org/trac/ops/wiki/Directorates>
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc_id }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %} {{ r.earlier_review_mark }}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
def reverse(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
DBTemplate.objects.filter(pk=182).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
The following reviewers have assignments:{% for r in review_requests %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.doc_id }}-{% if r.requested_rev %}{{ r.requested_rev }}{% else %}{{ r.doc.rev }}{% endif %} {{ r.earlier_review_mark }}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=183).update(content="""{% autoescape off %}Subject: Review Assignments
Hi all,
The following reviewers have assignments:{% for r in review_requests %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer Type LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.deadline|date:"Y-m-d" }}{% else %}{{r.type.name|ljust:"10"}}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.doc_id }}-{% if r.requested_rev %}{{ r.requested_rev }}{% else %}{{ r.doc.rev }}{% endif %}{% if r.earlier_review_mark %} {{ r.earlier_review_mark }}{% endif %}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}
The LC and Telechat review templates are included below:
-------------------------------------------------------
-- Begin LC Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please treat these comments just
like any other last call comments.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End LC Template --
-- Begin Telechat Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please wait for direction from your
document shepherd or AD before posting a new version of the draft.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End Telechat Template --
{% endautoescape %}
""")
DBTemplate.objects.filter(pk=184).update(content="""{% autoescape off %}Subject: Assignments
Review instructions and related resources are at:
http://tools.ietf.org/area/sec/trac/wiki/SecDirReview{% for r in review_requests %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }}{{ r.earlier_review|yesno:'R, , ' }}{% if r.section == 'Early review requests:' %}{{ r.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.doc_id }}-{% if r.requested_rev %}{{ r.requested_rev }}{% else %}{{ r.doc.rev }}{% endif %}{% endfor %}
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=185).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
Review instructions and related resources are at:
<https://trac.ietf.org/trac/ops/wiki/Directorates>
The following reviewers have assignments:{% for r in review_requests %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.doc_id }}-{% if r.requested_rev %}{{ r.requested_rev }}{% else %}{{ r.doc.rev }}{% endif %} {{ r.earlier_review_mark }}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
class Migration(migrations.Migration):
dependencies = [
('dbtemplate', '0003_adjust_review_templates'),
]
operations = [
migrations.RunPython(forward,reverse),
]

View file

@ -1,281 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-03-13 13:41
from django.db import migrations
def forward(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
DBTemplate.objects.filter(pk=182).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc.name }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %} {{ r.earlier_reviews }}{% endfor %}
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=183).update(content="""{% autoescape off %}Subject: Review Assignments
Hi all,
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer Type LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{r.review_request.type.name|ljust:"10"}}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc.name }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %}{% if r.earlier_reviews %} {{ r.earlier_reviews }}{% endif %}{% endfor %}
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}
The LC and Telechat review templates are included below:
-------------------------------------------------------
-- Begin LC Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please treat these comments just
like any other last call comments.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End LC Template --
-- Begin Telechat Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please wait for direction from your
document shepherd or AD before posting a new version of the draft.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End Telechat Template --
{% endautoescape %}
""")
DBTemplate.objects.filter(pk=184).update(content="""{% autoescape off %}Subject: Assignments
Review instructions and related resources are at:
http://tools.ietf.org/area/sec/trac/wiki/SecDirReview{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }}{{ r.earlier_review|yesno:'R, , ' }}{% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc.name }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %}{% endfor %}
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=185).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
Review instructions and related resources are at:
<https://trac.ietf.org/trac/ops/wiki/Directorates>
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc.name }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %} {{ r.earlier_reviews }}{% endfor %}
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
def reverse(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
DBTemplate.objects.filter(pk=182).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc_id }}-{% if r.review_request..requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request..doc.rev }}{% endif %} {{ r.earlier_review_mark }}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=183).update(content="""{% autoescape off %}Subject: Review Assignments
Hi all,
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer Type LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{r.review_request.type.name|ljust:"10"}}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc.name }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %}{% if r.earlier_review_mark %} {{ r.earlier_review_mark }}{% endif %}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}
The LC and Telechat review templates are included below:
-------------------------------------------------------
-- Begin LC Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please treat these comments just
like any other last call comments.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End LC Template --
-- Begin Telechat Template --
I am the assigned Gen-ART reviewer for this draft. The General Area
Review Team (Gen-ART) reviews all IETF documents being processed
by the IESG for the IETF Chair. Please wait for direction from your
document shepherd or AD before posting a new version of the draft.
For more information, please see the FAQ at
<https://trac.ietf.org/trac/gen/wiki/GenArtfaq>.
Document:
Reviewer:
Review Date:
IETF LC End Date:
IESG Telechat date: (if known)
Summary:
Major issues:
Minor issues:
Nits/editorial comments:
-- End Telechat Template --
{% endautoescape %}
""")
DBTemplate.objects.filter(pk=184).update(content="""{% autoescape off %}Subject: Assignments
Review instructions and related resources are at:
http://tools.ietf.org/area/sec/trac/wiki/SecDirReview{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }}{{ r.earlier_review|yesno:'R, , ' }}{% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc.name }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %}{% endfor %}
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
DBTemplate.objects.filter(pk=185).update(content="""{% autoescape off %}Subject: Open review assignments in {{group.acronym}}
Review instructions and related resources are at:
<https://trac.ietf.org/trac/ops/wiki/Directorates>
The following reviewers have assignments:{% for r in review_assignments %}{% ifchanged r.section %}
{{r.section}}
{% if r.section == 'Early review requests:' %}Reviewer Due Draft{% else %}Reviewer LC end Draft{% endif %}{% endifchanged %}
{{ r.reviewer.person.plain_name|ljust:"22" }} {% if r.section == 'Early review requests:' %}{{ r.review_request.deadline|date:"Y-m-d" }}{% else %}{{ r.lastcall_ends|default:"None " }}{% endif %} {{ r.review_request.doc.name }}-{% if r.review_request.requested_rev %}{{ r.review_request.requested_rev }}{% else %}{{ r.review_request.doc.rev }}{% endif %} {{ r.earlier_review_mark }}{% endfor %}
* Other revision previously reviewed
** This revision already reviewed
{% if rotation_list %}Next in the reviewer rotation:
{% for p in rotation_list %} {{ p }}
{% endfor %}{% endif %}{% endautoescape %}
""")
class Migration(migrations.Migration):
dependencies = [
('dbtemplate', '0004_adjust_assignment_email_summary_templates'),
]
operations = [
migrations.RunPython(forward,reverse),
]

View file

@ -1,33 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from django.db import migrations
def forward(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate', 'DBTemplate')
DBTemplate.objects.create(path='/group/defaults/email/review_assigned.txt', type_id='django',
content="""{{ assigner.ascii }} has assigned you as a reviewer for this document.
{% if prev_team_reviews %}This team has completed other reviews of this document:{% endif %}{% for assignment in prev_team_reviews %}
- {{ assignment.completed_on }} {{ assignment.reviewer.person.ascii }} -{% if assignment.reviewed_rev %}{{ assignment.reviewed_rev }}{% else %}{{ assignment.review_request.requested_rev }}{% endif %} {{ assignment.result.name }}
{% endfor %}
""")
def reverse(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate', 'DBTemplate')
DBTemplate.objects.get(path='/group/defaults/email/review_assigned.txt').delete()
class Migration(migrations.Migration):
dependencies = [
('dbtemplate', '0005_adjust_assignment_email_summary_templates_2526'),
]
operations = [
migrations.RunPython(forward,reverse),
]

View file

@ -1,38 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-11-19 11:47
from django.db import migrations
def forward(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
qs = DBTemplate.objects.filter(path='/group/defaults/email/review_assigned.txt')
qs.update(content="""{{ assigner.ascii }} has assigned {{ reviewer.person.ascii }} as a reviewer for this document.
{% if prev_team_reviews %}This team has completed other reviews of this document:{% endif %}{% for assignment in prev_team_reviews %}
- {{ assignment.completed_on }} {{ assignment.reviewer.person.ascii }} -{% if assignment.reviewed_rev %}{{ assignment.reviewed_rev }}{% else %}{{ assignment.review_request.requested_rev }}{% endif %} {{ assignment.result.name }}
{% endfor %}
""")
qs.update(title="Default template for review assignment email")
def reverse(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate','DBTemplate')
qs = DBTemplate.objects.filter(path='/group/defaults/email/review_assigned.txt')
qs.update(content="""{{ assigner.ascii }} has assigned you as a reviewer for this document.
{% if prev_team_reviews %}This team has completed other reviews of this document:{% endif %}{% for assignment in prev_team_reviews %}
- {{ assignment.completed_on }} {{ assignment.reviewer.person.ascii }} -{% if assignment.reviewed_rev %}{{ assignment.reviewed_rev }}{% else %}{{ assignment.review_request.requested_rev }}{% endif %} {{ assignment.result.name }}
{% endfor %}
""")
class Migration(migrations.Migration):
dependencies = [
('dbtemplate', '0006_add_review_assigned_template'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,32 +0,0 @@
# Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-07 09:25
from django.db import migrations
def forward(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate', 'DBTemplate')
DBTemplate.objects.create(path='/nomcom/defaults/iesg_requirements', type_id='rst', title='Generic IESG requirements',
content="""=============================
IESG MEMBER DESIRED EXPERTISE
=============================
Place this year's Generic IESG Member Desired Expertise here.
This template uses reStructured text for formatting. Feel free to use it (to change the above header for example).
""")
def reverse(apps, schema_editor):
DBTemplate = apps.get_model('dbtemplate', 'DBTemplate')
DBTemplate.objects.filter(path='/nomcom/defaults/iesg_requirements').delete()
class Migration(migrations.Migration):
dependencies = [
('dbtemplate', '0007_adjust_review_assigned'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,12 +1,9 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
# Generated by Django 2.2.28 on 2023-03-20 19:22
import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import ietf.utils.models
@ -39,13 +36,14 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('json', models.TextField(help_text='Deleted object in JSON format, with attribute names chosen to be suitable for passing into the relevant create method.')),
('time', models.DateTimeField(default=datetime.datetime.now)),
('time', models.DateTimeField(default=django.utils.timezone.now)),
],
),
migrations.CreateModel(
name='DocAlias',
fields=[
('name', models.CharField(max_length=255, primary_key=True, serialize=False)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True)),
],
options={
'verbose_name': 'document alias',
@ -56,8 +54,8 @@ class Migration(migrations.Migration):
name='DocEvent',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('time', models.DateTimeField(db_index=True, default=datetime.datetime.now, help_text='When the event happened')),
('type', models.CharField(choices=[(b'new_revision', b'Added new revision'), (b'new_submission', b'Uploaded new revision'), (b'changed_document', b'Changed document metadata'), (b'added_comment', b'Added comment'), (b'added_message', b'Added message'), (b'edited_authors', b'Edited the documents author list'), (b'deleted', b'Deleted document'), (b'changed_state', b'Changed state'), (b'changed_stream', b'Changed document stream'), (b'expired_document', b'Expired document'), (b'extended_expiry', b'Extended expiry of document'), (b'requested_resurrect', b'Requested resurrect'), (b'completed_resurrect', b'Completed resurrect'), (b'changed_consensus', b'Changed consensus'), (b'published_rfc', b'Published RFC'), (b'added_suggested_replaces', b'Added suggested replacement relationships'), (b'reviewed_suggested_replaces', b'Reviewed suggested replacement relationships'), (b'changed_group', b'Changed group'), (b'changed_protocol_writeup', b'Changed protocol writeup'), (b'changed_charter_milestone', b'Changed charter milestone'), (b'initial_review', b'Set initial review time'), (b'changed_review_announcement', b'Changed WG Review text'), (b'changed_action_announcement', b'Changed WG Action text'), (b'started_iesg_process', b'Started IESG process on document'), (b'created_ballot', b'Created ballot'), (b'closed_ballot', b'Closed ballot'), (b'sent_ballot_announcement', b'Sent ballot announcement'), (b'changed_ballot_position', b'Changed ballot position'), (b'changed_ballot_approval_text', b'Changed ballot approval text'), (b'changed_ballot_writeup_text', b'Changed ballot writeup text'), (b'changed_rfc_editor_note_text', b'Changed RFC Editor Note text'), (b'changed_last_call_text', b'Changed last call text'), (b'requested_last_call', b'Requested last call'), (b'sent_last_call', b'Sent last call'), (b'scheduled_for_telechat', b'Scheduled for telechat'), (b'iesg_approved', b'IESG approved document (no problem)'), (b'iesg_disapproved', b'IESG disapproved document (do not publish)'), (b'approved_in_minute', b'Approved in minute'), (b'iana_review', b'IANA review comment'), (b'rfc_in_iana_registry', b'RFC is in IANA registry'), (b'rfc_editor_received_announcement', b'Announcement was received by RFC Editor'), (b'requested_publication', b'Publication at RFC Editor requested'), (b'sync_from_rfc_editor', b'Received updated information from RFC Editor'), (b'requested_review', b'Requested review'), (b'assigned_review_request', b'Assigned review request'), (b'closed_review_request', b'Closed review request'), (b'downref_approved', b'Downref approved')], max_length=50)),
('time', models.DateTimeField(db_index=True, default=django.utils.timezone.now, help_text='When the event happened')),
('type', models.CharField(choices=[('new_revision', 'Added new revision'), ('new_submission', 'Uploaded new revision'), ('changed_document', 'Changed document metadata'), ('added_comment', 'Added comment'), ('added_message', 'Added message'), ('edited_authors', 'Edited the documents author list'), ('deleted', 'Deleted document'), ('changed_state', 'Changed state'), ('changed_stream', 'Changed document stream'), ('expired_document', 'Expired document'), ('extended_expiry', 'Extended expiry of document'), ('requested_resurrect', 'Requested resurrect'), ('completed_resurrect', 'Completed resurrect'), ('changed_consensus', 'Changed consensus'), ('published_rfc', 'Published RFC'), ('added_suggested_replaces', 'Added suggested replacement relationships'), ('reviewed_suggested_replaces', 'Reviewed suggested replacement relationships'), ('changed_action_holders', 'Changed action holders for document'), ('changed_group', 'Changed group'), ('changed_protocol_writeup', 'Changed protocol writeup'), ('changed_charter_milestone', 'Changed charter milestone'), ('initial_review', 'Set initial review time'), ('changed_review_announcement', 'Changed WG Review text'), ('changed_action_announcement', 'Changed WG Action text'), ('started_iesg_process', 'Started IESG process on document'), ('created_ballot', 'Created ballot'), ('closed_ballot', 'Closed ballot'), ('sent_ballot_announcement', 'Sent ballot announcement'), ('changed_ballot_position', 'Changed ballot position'), ('changed_ballot_approval_text', 'Changed ballot approval text'), ('changed_ballot_writeup_text', 'Changed ballot writeup text'), ('changed_rfc_editor_note_text', 'Changed RFC Editor Note text'), ('changed_last_call_text', 'Changed last call text'), ('requested_last_call', 'Requested last call'), ('sent_last_call', 'Sent last call'), ('scheduled_for_telechat', 'Scheduled for telechat'), ('iesg_approved', 'IESG approved document (no problem)'), ('iesg_disapproved', 'IESG disapproved document (do not publish)'), ('approved_in_minute', 'Approved in minute'), ('iana_review', 'IANA review comment'), ('rfc_in_iana_registry', 'RFC is in IANA registry'), ('rfc_editor_received_announcement', 'Announcement was received by RFC Editor'), ('requested_publication', 'Publication at RFC Editor requested'), ('sync_from_rfc_editor', 'Received updated information from RFC Editor'), ('requested_review', 'Requested review'), ('assigned_review_request', 'Assigned review request'), ('closed_review_request', 'Closed review request'), ('closed_review_assignment', 'Closed review assignment'), ('downref_approved', 'Downref approved'), ('posted_related_ipr', 'Posted related IPR'), ('removed_related_ipr', 'Removed related IPR'), ('changed_editors', 'Changed BOF Request editors')], max_length=50)),
('rev', models.CharField(blank=True, max_length=16, null=True, verbose_name='revision')),
('desc', models.TextField()),
],
@ -65,11 +63,22 @@ class Migration(migrations.Migration):
'ordering': ['-time', '-id'],
},
),
migrations.CreateModel(
name='DocExtResource',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('display_name', models.CharField(blank=True, default='', max_length=255)),
('value', models.CharField(max_length=2083)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='DocHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('time', models.DateTimeField(default=datetime.datetime.now)),
('time', models.DateTimeField(default=django.utils.timezone.now)),
('title', models.CharField(max_length=255, validators=[django.core.validators.RegexValidator(message='Please enter a string without control characters.', regex='^[^\x00-\x1f]*$')])),
('abstract', models.TextField(blank=True)),
('rev', models.CharField(blank=True, max_length=16, verbose_name='revision')),
@ -77,8 +86,9 @@ class Migration(migrations.Migration):
('words', models.IntegerField(blank=True, null=True)),
('order', models.IntegerField(blank=True, default=1)),
('expires', models.DateTimeField(blank=True, null=True)),
('notify', models.CharField(blank=True, max_length=255)),
('notify', models.TextField(blank=True, max_length=1023)),
('external_url', models.URLField(blank=True)),
('uploaded_filename', models.TextField(blank=True)),
('note', models.TextField(blank=True)),
('internal_comments', models.TextField(blank=True)),
('name', models.CharField(max_length=255)),
@ -112,7 +122,8 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Document',
fields=[
('time', models.DateTimeField(default=datetime.datetime.now)),
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('time', models.DateTimeField(default=django.utils.timezone.now)),
('title', models.CharField(max_length=255, validators=[django.core.validators.RegexValidator(message='Please enter a string without control characters.', regex='^[^\x00-\x1f]*$')])),
('abstract', models.TextField(blank=True)),
('rev', models.CharField(blank=True, max_length=16, verbose_name='revision')),
@ -120,77 +131,17 @@ class Migration(migrations.Migration):
('words', models.IntegerField(blank=True, null=True)),
('order', models.IntegerField(blank=True, default=1)),
('expires', models.DateTimeField(blank=True, null=True)),
('notify', models.CharField(blank=True, max_length=255)),
('notify', models.TextField(blank=True, max_length=1023)),
('external_url', models.URLField(blank=True)),
('uploaded_filename', models.TextField(blank=True)),
('note', models.TextField(blank=True)),
('internal_comments', models.TextField(blank=True)),
('name', models.CharField(max_length=255, primary_key=True, serialize=False, validators=[django.core.validators.RegexValidator(b'^[-a-z0-9]+$', b'Provide a valid document name consisting of lowercase letters, numbers and hyphens.', b'invalid')])),
('ad', ietf.utils.models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ad_document_set', to='person.Person', verbose_name='area director')),
('formal_languages', models.ManyToManyField(blank=True, help_text='Formal languages used in document', to='name.FormalLanguageName')),
('name', models.CharField(max_length=255, unique=True, validators=[django.core.validators.RegexValidator('^[-a-z0-9]+$', 'Provide a valid document name consisting of lowercase letters, numbers and hyphens.', 'invalid')])),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='DocumentAuthor',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('affiliation', models.CharField(blank=True, help_text='Organization/company used by author for submission', max_length=100)),
('country', models.CharField(blank=True, help_text='Country used by author for submission', max_length=255)),
('order', models.IntegerField(default=1)),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('email', ietf.utils.models.ForeignKey(blank=True, help_text='Email address used by author for submission', null=True, on_delete=django.db.models.deletion.CASCADE, to='person.Email')),
('person', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='person.Person')),
],
options={
'ordering': ['document', 'order'],
'abstract': False,
},
),
migrations.CreateModel(
name='DocumentURL',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('desc', models.CharField(blank=True, default='', max_length=255)),
('url', models.URLField(max_length=512)),
('doc', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('tag', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.DocUrlTagName')),
],
),
migrations.CreateModel(
name='RelatedDocHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('relationship', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.DocRelationshipName')),
('source', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.DocHistory')),
('target', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reversely_related_document_history_set', to='doc.DocAlias')),
],
),
migrations.CreateModel(
name='RelatedDocument',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('relationship', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.DocRelationshipName')),
('source', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('target', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.DocAlias')),
],
),
migrations.CreateModel(
name='State',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('slug', models.SlugField()),
('name', models.CharField(max_length=255)),
('used', models.BooleanField(default=True)),
('desc', models.TextField(blank=True)),
('order', models.IntegerField(default=0)),
('next_states', models.ManyToManyField(blank=True, related_name='previous_states', to='doc.State')),
],
options={
'ordering': ['type', 'order'],
},
),
migrations.CreateModel(
name='StateType',
fields=[
@ -221,6 +172,21 @@ class Migration(migrations.Migration):
('discuss_time', models.DateTimeField(blank=True, help_text='Time discuss text was written', null=True)),
('comment', models.TextField(blank=True, help_text='Optional comment')),
('comment_time', models.DateTimeField(blank=True, help_text='Time optional comment was written', null=True)),
('send_email', models.BooleanField(default=None, null=True)),
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='BofreqEditorDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='BofreqResponsibleDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
],
bases=('doc.docevent',),
),
@ -228,7 +194,7 @@ class Migration(migrations.Migration):
name='ConsensusDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
('consensus', models.NullBooleanField(default=None)),
('consensus', models.BooleanField(default=None, null=True)),
],
bases=('doc.docevent',),
),
@ -240,6 +206,13 @@ class Migration(migrations.Migration):
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='IanaExpertDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='InitialReviewDocEvent',
fields=[
@ -263,6 +236,13 @@ class Migration(migrations.Migration):
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='ReviewAssignmentDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='ReviewRequestDocEvent',
fields=[
@ -301,9 +281,88 @@ class Migration(migrations.Migration):
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='State',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('slug', models.SlugField()),
('name', models.CharField(max_length=255)),
('used', models.BooleanField(default=True)),
('desc', models.TextField(blank=True)),
('order', models.IntegerField(default=0)),
('next_states', models.ManyToManyField(blank=True, related_name='previous_states', to='doc.State')),
('type', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.StateType')),
],
options={
'ordering': ['type', 'order'],
},
),
migrations.CreateModel(
name='RelatedDocument',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('relationship', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.DocRelationshipName')),
('source', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('target', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.DocAlias')),
],
),
migrations.CreateModel(
name='RelatedDocHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('relationship', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.DocRelationshipName')),
('source', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.DocHistory')),
('target', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reversely_related_document_history_set', to='doc.DocAlias')),
],
),
migrations.CreateModel(
name='DocumentURL',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('desc', models.CharField(blank=True, default='', max_length=255)),
('url', models.URLField(max_length=2083)),
('doc', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('tag', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.DocUrlTagName')),
],
),
migrations.CreateModel(
name='DocumentAuthor',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('affiliation', models.CharField(blank=True, help_text='Organization/company used by author for submission', max_length=100)),
('country', models.CharField(blank=True, help_text='Country used by author for submission', max_length=255)),
('order', models.IntegerField(default=1)),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('email', ietf.utils.models.ForeignKey(blank=True, help_text='Email address used by author for submission', null=True, on_delete=django.db.models.deletion.CASCADE, to='person.Email')),
('person', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='person.Person')),
],
options={
'ordering': ['document', 'order'],
'abstract': False,
},
),
migrations.CreateModel(
name='DocumentActionHolder',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('time_added', models.DateTimeField(default=django.utils.timezone.now)),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('person', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='person.Person')),
],
),
migrations.AddField(
model_name='state',
name='type',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.StateType'),
model_name='document',
name='action_holders',
field=models.ManyToManyField(blank=True, through='doc.DocumentActionHolder', to='person.Person'),
),
migrations.AddField(
model_name='document',
name='ad',
field=ietf.utils.models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ad_document_set', to='person.Person', verbose_name='area director'),
),
migrations.AddField(
model_name='document',
name='formal_languages',
field=models.ManyToManyField(blank=True, help_text='Formal languages used in document', to='name.FormalLanguageName'),
),
]

View file

@ -1,7 +1,4 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 10:52
# Generated by Django 2.2.28 on 2023-03-20 19:22
from django.db import migrations, models
import django.db.models.deletion
@ -13,14 +10,14 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('review', '0001_initial'),
('contenttypes', '0002_remove_content_type_name'),
('name', '0001_initial'),
('submit', '0001_initial'),
('person', '0001_initial'),
('message', '0001_initial'),
('doc', '0001_initial'),
('name', '0001_initial'),
('person', '0001_initial'),
('review', '0001_initial'),
('group', '0001_initial'),
('contenttypes', '0002_remove_content_type_name'),
('submit', '0001_initial'),
('doc', '0001_initial'),
]
operations = [
@ -144,6 +141,16 @@ class Migration(migrations.Migration):
name='type',
field=ietf.utils.models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='name.DocTypeName'),
),
migrations.AddField(
model_name='docextresource',
name='doc',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AddField(
model_name='docextresource',
name='name',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.ExtResourceName'),
),
migrations.AddField(
model_name='docevent',
name='by',
@ -156,8 +163,8 @@ class Migration(migrations.Migration):
),
migrations.AddField(
model_name='docalias',
name='document',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
name='docs',
field=models.ManyToManyField(related_name='docalias', to='doc.Document'),
),
migrations.AddField(
model_name='deletedevent',
@ -179,6 +186,14 @@ class Migration(migrations.Migration):
name='positions',
field=models.ManyToManyField(blank=True, to='name.BallotPositionName'),
),
migrations.CreateModel(
name='IRSGBallotDocEvent',
fields=[
('ballotdocevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.BallotDocEvent')),
('duedate', models.DateTimeField(blank=True, null=True)),
],
bases=('doc.ballotdocevent',),
),
migrations.AddField(
model_name='submissiondocevent',
name='submission',
@ -205,15 +220,55 @@ class Migration(migrations.Migration):
field=ietf.utils.models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='name.ReviewRequestStateName'),
),
migrations.AddField(
model_name='ballotpositiondocevent',
name='ad',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='person.Person'),
model_name='reviewassignmentdocevent',
name='review_assignment',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.ReviewAssignment'),
),
migrations.AddField(
model_name='reviewassignmentdocevent',
name='state',
field=ietf.utils.models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='name.ReviewAssignmentStateName'),
),
migrations.AddIndex(
model_name='documentauthor',
index=models.Index(fields=['document', 'order'], name='doc_documen_documen_7fabe2_idx'),
),
migrations.AddConstraint(
model_name='documentactionholder',
constraint=models.UniqueConstraint(fields=('document', 'person'), name='unique_action_holder'),
),
migrations.AddIndex(
model_name='dochistoryauthor',
index=models.Index(fields=['document', 'order'], name='doc_dochist_documen_7e2441_idx'),
),
migrations.AddIndex(
model_name='docevent',
index=models.Index(fields=['type', 'doc'], name='doc_doceven_type_43e53e_idx'),
),
migrations.AddIndex(
model_name='docevent',
index=models.Index(fields=['-time', '-id'], name='doc_doceven_time_1a258f_idx'),
),
migrations.AddField(
model_name='bofreqresponsibledocevent',
name='responsible',
field=models.ManyToManyField(blank=True, to='person.Person'),
),
migrations.AddField(
model_name='bofreqeditordocevent',
name='editors',
field=models.ManyToManyField(blank=True, to='person.Person'),
),
migrations.AddField(
model_name='ballotpositiondocevent',
name='ballot',
field=ietf.utils.models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.BallotDocEvent'),
),
migrations.AddField(
model_name='ballotpositiondocevent',
name='balloter',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='person.Person'),
),
migrations.AddField(
model_name='ballotpositiondocevent',
name='pos',

View file

@ -1,20 +0,0 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-01 12:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0002_auto_20180220_1052'),
]
operations = [
migrations.AddIndex(
model_name='docevent',
index=models.Index(fields=['type', 'doc'], name='doc_doceven_type_43e53e_idx'),
),
]

View file

@ -1,30 +0,0 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-03 11:50
from django.db import migrations
def forward(apps, schema_editor):
State = apps.get_model('doc','State')
for type_id in ('draft-stream-iab','draft-stream-ise','draft-stream-irtf'):
State.objects.create(type_id=type_id,
slug='repl',
name='Replaced',
desc='Replaced',
)
def reverse(apps, schema_editor):
State = apps.get_model('doc','State')
State.objects.filter(type_id__in=('draft-stream-iab','draft-stream-ise','draft-stream-irtf'), slug='repl').delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0003_auto_20180401_1231'),
]
operations = [
migrations.RunPython(forward,reverse)
]

View file

@ -1,112 +0,0 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-03 12:16
from django.db import migrations
def forward(apps, schema_editor):
Document = apps.get_model('doc','Document')
State = apps.get_model('doc','State')
iab_active = State.objects.get(type_id='draft-stream-iab',slug='active')
iab_replaced = State.objects.get(type_id='draft-stream-iab',slug='repl')
irtf_active = State.objects.get(type_id='draft-stream-irtf',slug='active')
irtf_candidate = State.objects.get(type_id='draft-stream-irtf',slug='candidat')
irtf_replaced = State.objects.get(type_id='draft-stream-irtf',slug='repl')
irtf_dead = State.objects.get(type_id='draft-stream-irtf',slug='dead')
doc = Document.objects.get(name='draft-flanagan-rfc-preservation')
doc.states.remove(iab_active)
doc.states.add(iab_replaced)
doc = Document.objects.get(name='draft-trammell-semi-report')
doc.states.remove(iab_active)
doc.states.add(iab_replaced)
doc = Document.objects.get(name='draft-nir-cfrg-chacha20-poly1305')
doc.states.remove(irtf_candidate)
doc.states.add(irtf_replaced)
doc = Document.objects.get(name='draft-ladd-spake2')
doc.states.remove(irtf_candidate)
doc.states.add(irtf_replaced)
doc = Document.objects.get(name='draft-lee-nfvrg-resource-management-service-chain')
doc.states.remove(irtf_candidate)
doc.states.add(irtf_replaced)
doc = Document.objects.get(name='draft-keranen-t2trg-rest-iot')
doc.states.remove(irtf_candidate)
doc.states.add(irtf_replaced)
doc = Document.objects.get(name='draft-josefsson-argon2')
doc.states.remove(irtf_active)
doc.states.add(irtf_replaced)
doc = Document.objects.get(name='draft-tenoever-hrpc-research')
doc.states.remove(irtf_active)
doc.states.add(irtf_replaced)
doc = Document.objects.get(name='draft-kutscher-icnrg-challenges')
doc.states.remove(irtf_dead)
doc.states.add(irtf_replaced)
def reverse(apps, schema_editor):
Document = apps.get_model('doc','Document')
State = apps.get_model('doc','State')
iab_active = State.objects.get(type_id='draft-stream-iab',slug='active')
iab_replaced = State.objects.get(type_id='draft-stream-iab',slug='repl')
irtf_active = State.objects.get(type_id='draft-stream-irtf',slug='active')
irtf_candidate = State.objects.get(type_id='draft-stream-irtf',slug='candidat')
irtf_replaced = State.objects.get(type_id='draft-stream-irtf',slug='repl')
irtf_dead = State.objects.get(type_id='draft-stream-irtf',slug='dead')
doc = Document.objects.get(name='draft-flanagan-rfc-preservation')
doc.states.add(iab_active)
doc.states.remove(iab_replaced)
doc = Document.objects.get(name='draft-trammell-semi-report')
doc.states.add(iab_active)
doc.states.remove(iab_replaced)
doc = Document.objects.get(name='draft-nir-cfrg-chacha20-poly1305')
doc.states.add(irtf_candidate)
doc.states.remove(irtf_replaced)
doc = Document.objects.get(name='draft-ladd-spake2')
doc.states.add(irtf_candidate)
doc.states.remove(irtf_replaced)
doc = Document.objects.get(name='draft-lee-nfvrg-resource-management-service-chain')
doc.states.add(irtf_candidate)
doc.states.remove(irtf_replaced)
doc = Document.objects.get(name='draft-keranen-t2trg-rest-iot')
doc.states.add(irtf_candidate)
doc.states.remove(irtf_replaced)
doc = Document.objects.get(name='draft-josefsson-argon2')
doc.states.add(irtf_active)
doc.states.remove(irtf_replaced)
doc = Document.objects.get(name='draft-tenoever-hrpc-research')
doc.states.add(irtf_active)
doc.states.remove(irtf_replaced)
doc = Document.objects.get(name='draft-kutscher-icnrg-challenges')
doc.states.add(irtf_dead)
doc.states.remove(irtf_replaced)
class Migration(migrations.Migration):
dependencies = [
('doc', '0004_add_draft_stream_replaced_states'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,21 +0,0 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-03 06:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0005_fix_replaced_iab_irtf_stream_docs'),
]
operations = [
migrations.AddField(
model_name='ballotpositiondocevent',
name='send_email',
field=models.NullBooleanField(default=None),
),
]

View file

@ -1,51 +0,0 @@
# Copyright The IETF Trust 2018-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-04 10:56
from tqdm import tqdm
from django.db import migrations
def forward(apps, schema_editor):
State = apps.get_model('doc','State')
Document = apps.get_model('doc','Document')
DocHistory = apps.get_model('doc','DocHistory')
idexists = State.objects.create(
type_id = 'draft-iesg',
slug = 'idexists',
name = 'I-D Exists',
used = True,
desc = 'The IESG has not started processing this draft, or has stopped processing it without publicastion.',
order = 0,
)
idexists.next_states.set(State.objects.filter(type='draft-iesg',slug__in=['pub-req','watching']))
#for doc in tqdm(Document.objects.filter(type='draft'):
# if not doc.states.filter(type='draft-iesg').exists():
# doc.states.add(idexists)
# for dh in doc.history_set.all():
# if not dh.states.filter(type='draft-iesg').exists():
# dh.states.add(idexists)
for doc in tqdm(Document.objects.filter(type_id='draft').exclude(states__type_id='draft-iesg')):
doc.states.add(idexists)
for history in tqdm(DocHistory.objects.filter(type_id='draft').exclude(states__type_id='draft-iesg')):
history.states.add(idexists)
def reverse(apps, schema_editor):
State = apps.get_model('doc','State')
State.objects.filter(slug='idexists').delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0006_ballotpositiondocevent_send_email'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,26 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-28 13:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0007_idexists'),
]
operations = [
migrations.AddField(
model_name='dochistory',
name='uploaded_filename',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='document',
name='uploaded_filename',
field=models.TextField(blank=True),
),
]

View file

@ -1,49 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2018-12-28 13:33
from django.db import migrations
from django.db.models import F
def forward(apps, schema_editor):
Document = apps.get_model('doc','Document')
Document.objects.exclude(type_id__in=('review','recording')).update(uploaded_filename = F('external_url'))
Document.objects.exclude(type_id__in=('review','recording')).update(external_url="")
Document.objects.filter(name='slides-100-edu-sessf-patents-at-ietf-an-overview-of-bcp79bis').update(uploaded_filename='slides-100-edu-sessf-patents-at-ietf-an-overview-of-bcp79bis-00.pdf')
DocHistory = apps.get_model('doc','DocHistory')
DocHistory.objects.exclude(type_id__in=('review','recording')).update(uploaded_filename = F('external_url'))
DocHistory.objects.exclude(type_id__in=('review','recording')).update(external_url="")
DocHistory.objects.filter(uploaded_filename='https://www.ietf.org/proceedings/97/slides/slides-97-edu-sessb-local-version-of-newcomers-training-in-korean-00.pdf').update(uploaded_filename='slides-97-edu-sessb-local-version-of-newcomers-training-in-korean-00.pdf')
DocHistory.objects.filter(uploaded_filename='http://materials-98-codec-opus-newvectors-00.tar.gz').update(uploaded_filename='materials-98-codec-opus-newvectors-00.tar.gz')
DocHistory.objects.filter(uploaded_filename='http://materials-98-codec-opus-update-00.patch').update(uploaded_filename='materials-98-codec-opus-update-00.patch')
DocHistory.objects.filter(uploaded_filename='http://slides-100-edu-sessf-patents-at-ietf-an-overview-of-bcp79bis-00.pdf').update(uploaded_filename='slides-100-edu-sessf-patents-at-ietf-an-overview-of-bcp79bis-00.pdf')
DocHistory.objects.filter(uploaded_filename='http://bluesheets-97-6man-201611150930-00.pdf/').update(uploaded_filename='bluesheets-97-6man-201611150930-00.pdf')
DocHistory.objects.filter(uploaded_filename='http://agenda-interim-2017-stir-01-stir-01-01.txt').update(uploaded_filename='agenda-interim-2017-stir-01-stir-01-01.txt')
DocHistory.objects.filter(uploaded_filename='http://agenda-interim-2017-icnrg-02-icnrg-01-05.html').update(uploaded_filename='agenda-interim-2017-icnrg-02-icnrg-01-05.html')
def reverse(apps, schema_editor):
Document = apps.get_model('doc','Document')
Document.objects.exclude(type_id__in=('review','recording')).update(external_url = F('uploaded_filename'))
Document.objects.exclude(type_id__in=('review','recording')).update(uploaded_filename="")
DocHistory = apps.get_model('doc','DocHistory')
DocHistory.objects.exclude(type_id__in=('review','recording')).update(external_url = F('uploaded_filename'))
DocHistory.objects.exclude(type_id__in=('review','recording')).update(uploaded_filename="")
class Migration(migrations.Migration):
dependencies = [
('doc', '0008_add_uploaded_filename'),
('review', '0008_remove_reviewrequest_old_id'),
('meeting', '0011_auto_20190114_0550'),
]
operations = [
migrations.RunPython(forward,reverse),
]

View file

@ -1,21 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-02-25 13:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0009_move_non_url_externalurls_to_uploaded_filename'),
]
operations = [
migrations.AlterField(
model_name='documenturl',
name='url',
field=models.URLField(max_length=2083),
),
]

View file

@ -1,29 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-11 11:22
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
class Migration(migrations.Migration):
dependencies = [
('review', '0009_refactor_review_request'),
('name', '0005_reviewassignmentstatename'),
('doc', '0010_auto_20190225_1302'),
]
operations = [
migrations.CreateModel(
name='ReviewAssignmentDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
('review_assignment', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.ReviewAssignment')),
('state', ietf.utils.models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='name.ReviewAssignmentStateName')),
],
bases=('doc.docevent',),
),
]

View file

@ -1,24 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-01 04:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0011_reviewassignmentdocevent'),
# present to facilitate migration to just before review.0010:
('name', '0006_adjust_statenames'),
('dbtemplate', '0004_adjust_assignment_email_summary_templates'),
]
operations = [
migrations.AlterField(
model_name='docevent',
name='type',
field=models.CharField(choices=[('new_revision', 'Added new revision'), ('new_submission', 'Uploaded new revision'), ('changed_document', 'Changed document metadata'), ('added_comment', 'Added comment'), ('added_message', 'Added message'), ('edited_authors', 'Edited the documents author list'), ('deleted', 'Deleted document'), ('changed_state', 'Changed state'), ('changed_stream', 'Changed document stream'), ('expired_document', 'Expired document'), ('extended_expiry', 'Extended expiry of document'), ('requested_resurrect', 'Requested resurrect'), ('completed_resurrect', 'Completed resurrect'), ('changed_consensus', 'Changed consensus'), ('published_rfc', 'Published RFC'), ('added_suggested_replaces', 'Added suggested replacement relationships'), ('reviewed_suggested_replaces', 'Reviewed suggested replacement relationships'), ('changed_group', 'Changed group'), ('changed_protocol_writeup', 'Changed protocol writeup'), ('changed_charter_milestone', 'Changed charter milestone'), ('initial_review', 'Set initial review time'), ('changed_review_announcement', 'Changed WG Review text'), ('changed_action_announcement', 'Changed WG Action text'), ('started_iesg_process', 'Started IESG process on document'), ('created_ballot', 'Created ballot'), ('closed_ballot', 'Closed ballot'), ('sent_ballot_announcement', 'Sent ballot announcement'), ('changed_ballot_position', 'Changed ballot position'), ('changed_ballot_approval_text', 'Changed ballot approval text'), ('changed_ballot_writeup_text', 'Changed ballot writeup text'), ('changed_rfc_editor_note_text', 'Changed RFC Editor Note text'), ('changed_last_call_text', 'Changed last call text'), ('requested_last_call', 'Requested last call'), ('sent_last_call', 'Sent last call'), ('scheduled_for_telechat', 'Scheduled for telechat'), ('iesg_approved', 'IESG approved document (no problem)'), ('iesg_disapproved', 'IESG disapproved document (do not publish)'), ('approved_in_minute', 'Approved in minute'), ('iana_review', 'IANA review comment'), ('rfc_in_iana_registry', 'RFC is in IANA registry'), ('rfc_editor_received_announcement', 'Announcement was received by RFC Editor'), ('requested_publication', 'Publication at RFC Editor requested'), ('sync_from_rfc_editor', 'Received updated information from RFC Editor'), ('requested_review', 'Requested review'), ('assigned_review_request', 'Assigned review request'), ('closed_review_request', 'Closed review request'), ('closed_review_assignment', 'Closed review assignment'), ('downref_approved', 'Downref approved')], max_length=50),
),
]

View file

@ -1,26 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 08:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0012_add_event_type_closed_review_assignment'),
]
operations = [
migrations.AddField(
model_name='docalias',
name='id',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='document',
name='id',
field=models.IntegerField(default=0),
),
]

View file

@ -1,36 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 08:42
import sys
from tqdm import tqdm
from django.db import migrations
def forward(apps, schema_editor):
Document = apps.get_model('doc','Document')
sys.stderr.write('\n')
for i, d in enumerate(tqdm(Document.objects.all()), start=1):
d.id = i
d.save()
DocAlias = apps.get_model('doc','DocAlias')
for i, d in enumerate(tqdm(DocAlias.objects.all()), start=1):
d.id = i
d.save()
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('doc', '0013_add_document_docalias_id'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,122 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 10:29
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
class Migration(migrations.Migration):
dependencies = [
('doc', '0014_set_document_docalias_id'),
]
operations = [
# Fix name and id fields first
migrations.AlterField(
model_name='docalias',
name='name',
field=models.CharField(max_length=255, unique=True),
),
migrations.AlterField(
model_name='docalias',
name='id',
field=models.IntegerField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='document',
name='name',
field=models.CharField(max_length=255, unique=True, validators=[django.core.validators.RegexValidator('^[-a-z0-9]+$', 'Provide a valid document name consisting of lowercase letters, numbers and hyphens.', 'invalid')]),
),
migrations.AlterField(
model_name='document',
name='id',
field=models.IntegerField(primary_key=True, serialize=False),
),
# Then remaining fields
migrations.AddField(
model_name='docalias',
name='document2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id'),
),
migrations.AddField(
model_name='dochistory',
name='doc2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='history_set', to='doc.Document', to_field=b'id'),
),
migrations.AddField(
model_name='documentauthor',
name='document2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id'),
),
migrations.AddField(
model_name='documenturl',
name='doc2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id'),
),
migrations.AddField(
model_name='relateddochistory',
name='target2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reversely_related_document_history_set', to='doc.DocAlias', to_field=b'id'),
),
migrations.AddField(
model_name='relateddocument',
name='source2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id'),
),
migrations.AddField(
model_name='relateddocument',
name='target2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.DocAlias', to_field=b'id'),
),
migrations.AddField(
model_name='docevent',
name='doc2',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field='id'),
),
migrations.AlterField(
model_name='docalias',
name='document',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_docalias', to='doc.Document', to_field=b'name'),
),
migrations.AlterField(
model_name='dochistory',
name='doc',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_hist', to='doc.Document', to_field=b'name'),
),
migrations.AlterField(
model_name='documentauthor',
name='document',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_doc_auth', to='doc.Document', to_field=b'name'),
),
migrations.AlterField(
model_name='documenturl',
name='doc',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_doc_url', to='doc.Document', to_field=b'name'),
),
migrations.AlterField(
model_name='relateddochistory',
name='target',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_hist_target', to='doc.DocAlias', to_field=b'name'),
),
migrations.AlterField(
model_name='relateddocument',
name='source',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_rel_source', to='doc.Document', to_field=b'name'),
),
migrations.AlterField(
model_name='relateddocument',
name='target',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_rel_target', to='doc.DocAlias', to_field=b'name'),
),
migrations.AlterField(
model_name='docevent',
name='doc',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='old_docevent', to='doc.Document', to_field=b'name'),
),
]

View file

@ -1,94 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-28 12:42
import sys, time
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
def timestamp(apps, schema_editor):
sys.stderr.write('\n %s' % time.strftime('%Y-%m-%d %H:%M:%S'))
class Migration(migrations.Migration):
dependencies = [
('name', '0006_adjust_statenames'),
('doc', '0015_1_add_fk_to_document_id'),
]
operations = [
migrations.CreateModel(
name='DocumentLanguages',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field='name', related_name='doclanguages')),
('formallanguagename', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.FormalLanguageName')),
],
),
migrations.CreateModel(
name='DocumentStates',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field='name', related_name='docstates')),
('state', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.State')),
],
),
migrations.CreateModel(
name='DocumentTags',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field='name', related_name='doctags')),
('doctagname', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.DocTagName')),
],
),
migrations.AddField(
model_name='document',
name='formal_languages2',
field=models.ManyToManyField(blank=True, related_name='languagedocs', through='doc.DocumentLanguages', to='name.FormalLanguageName'),
),
migrations.AddField(
model_name='document',
name='states2',
field=models.ManyToManyField(blank=True, related_name='statedocs', through='doc.DocumentStates', to='doc.State'),
),
migrations.AddField(
model_name='document',
name='tags2',
field=models.ManyToManyField(blank=True, related_name='tagdocs', through='doc.DocumentTags', to='name.DocTagName'),
),
# Here we copy the content of the existing implicit m2m tables for
# the Document m2m fields into the explicit through tables, in order
# to be able to later set the correct id from name
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO doc_documentlanguages SELECT * FROM doc_document_formal_languages;",
""),
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO doc_documentstates SELECT * FROM doc_document_states;",
""),
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO doc_documenttags SELECT * FROM doc_document_tags;",
""),
migrations.RunPython(timestamp, timestamp),
migrations.AddField(
model_name='documentlanguages',
name='document2',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field='id', null=True, default=None),
),
migrations.AddField(
model_name='documentstates',
name='document2',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field='id', null=True, default=None), ),
migrations.AddField(
model_name='documenttags',
name='document2',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field='id', null=True, default=None),
),
]

View file

@ -1,113 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-08 14:04
import sys
from tqdm import tqdm
from django.db import migrations
def forward(apps, schema_editor):
def add_id_fk(o, a, nameid):
n = getattr(o, a+'_id')
if n:
i = nameid[n]
if not isinstance(i, int):
raise ValueError("Inappropriate value: %s: nameid[%s]: %s" % (o.__class__.__name__, n, i))
if getattr(o, a+'2_id') != i:
setattr(o, a+'2_id', i)
o.save()
DocAlias = apps.get_model('doc','DocAlias')
DocEvent = apps.get_model('doc', 'DocEvent')
DocHistory = apps.get_model('doc', 'DocHistory')
Document = apps.get_model('doc', 'Document')
DocumentAuthor = apps.get_model('doc', 'DocumentAuthor')
DocumentLanguages = apps.get_model('doc', 'DocumentLanguages')
DocumentStates = apps.get_model('doc', 'DocumentStates')
DocumentTags = apps.get_model('doc', 'DocumentTags')
DocumentURL = apps.get_model('doc', 'DocumentURL')
Group = apps.get_model('group', 'Group')
IprDocRel = apps.get_model('ipr', 'IprDocRel')
LiaisonStatementAttachment = apps.get_model('liaisons', 'LiaisonStatementAttachment')
RelatedDocHistory = apps.get_model('doc', 'RelatedDocHistory')
RelatedDocument = apps.get_model('doc', 'RelatedDocument')
ReviewAssignment = apps.get_model('review', 'ReviewAssignment')
ReviewRequest = apps.get_model('review', 'ReviewRequest')
ReviewWish = apps.get_model('review', 'ReviewWish')
SessionPresentation = apps.get_model('meeting', 'SessionPresentation')
Submission = apps.get_model('submit', 'Submission')
# Document id fixup ------------------------------------------------------------
objs = Document.objects.in_bulk()
nameid = { o.name: o.id for id, o in objs.items() }
sys.stderr.write('\n')
sys.stderr.write('Setting Document FKs:\n')
for C, a in [
( DocAlias , 'document'),
( DocEvent , 'doc'),
( DocHistory , 'doc'),
( DocumentAuthor , 'document'),
( DocumentLanguages , 'document'),
( DocumentStates , 'document'),
( DocumentTags , 'document'),
( DocumentURL , 'doc'),
( Group , 'charter'),
( LiaisonStatementAttachment , 'document'),
( RelatedDocument , 'source'),
( ReviewAssignment , 'review'),
( ReviewRequest , 'doc'),
( ReviewRequest , 'unused_review'),
( ReviewWish , 'doc'),
( SessionPresentation , 'document'),
( Submission , 'draft'),
]:
sys.stderr.write(' %s.%s:\n' % (C.__name__, a))
for o in tqdm(C.objects.all()):
add_id_fk(o, a, nameid)
# DocAlias id fixup ------------------------------------------------------------
sys.stderr.write('\n')
objs = DocAlias.objects.in_bulk()
nameid = { o.name: o.id for id, o in objs.items() }
sys.stderr.write('Setting DocAlias FKs:\n')
for C, a in [
( IprDocRel , 'document'),
( RelatedDocument , 'target'),
( RelatedDocHistory , 'target'),
]:
sys.stderr.write(' %s.%s:\n' % (C.__name__, a))
for o in tqdm(C.objects.all()):
add_id_fk(o, a, nameid)
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('community', '0004_set_document_m2m_keys'),
('doc', '0015_2_add_doc_document_m2m_fields'),
('group', '0014_set_document_m2m_keys'),
('ipr', '0003_add_ipdocrel_document2_fk'),
('liaisons', '0003_liaison_document2_fk'),
('meeting', '0015_sessionpresentation_document2_fk'),
('message', '0003_set_document_m2m_keys'),
('review', '0011_review_document2_fk'),
('submit', '0002_submission_document2_fk'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,26 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-09 05:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0016_set_document_docalias_fk'),
]
operations = [
migrations.AlterField(
model_name='docalias',
name='id',
field=models.AutoField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='document',
name='id',
field=models.AutoField(primary_key=True, serialize=False),
),
]

View file

@ -1,125 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-20 09:53
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
class Migration(migrations.Migration):
dependencies = [
('doc', '0017_make_document_id_primary_key'),
]
operations = [
migrations.AlterModelOptions(
name='documentauthor',
options={'ordering': ['document2', 'order']},
),
migrations.RemoveIndex(
model_name='docevent',
name='doc_doceven_type_43e53e_idx',
),
migrations.RemoveField(
model_name='docalias',
name='document',
),
migrations.RemoveField(
model_name='docevent',
name='doc',
),
migrations.RemoveField(
model_name='dochistory',
name='doc',
),
migrations.RemoveField(
model_name='documentauthor',
name='document',
),
migrations.RemoveField(
model_name='documenturl',
name='doc',
),
migrations.RemoveField(
model_name='relateddochistory',
name='target',
),
migrations.RemoveField(
model_name='relateddocument',
name='source',
),
migrations.RemoveField(
model_name='relateddocument',
name='target',
),
migrations.AddIndex(
model_name='docevent',
index=models.Index(fields=['type', 'doc2'], name='doc_doceven_type_ac7748_idx'),
),
# The following 9 migrations are related to the m2m fields on Document
# Remove the intermediary model field pointing to Document.name
migrations.RemoveField(
model_name='documentlanguages',
name='document',
),
migrations.RemoveField(
model_name='documentstates',
name='document',
),
migrations.RemoveField(
model_name='documenttags',
name='document',
),
# Rename the intermediary model field pointing to Document.id, to
# match the implicit m2m table
migrations.RenameField(
model_name='documentlanguages',
old_name='document2',
new_name='document',
),
migrations.RenameField(
model_name='documentstates',
old_name='document2',
new_name='document',
),
migrations.RenameField(
model_name='documenttags',
old_name='document2',
new_name='document',
),
# Alter the fields to point to Document.pk instead of Document.name
migrations.AlterField(
model_name='documentlanguages',
name='document',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AlterField(
model_name='documentstates',
name='document',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AlterField(
model_name='documenttags',
name='document',
field=ietf.utils.models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
# Remove the implicit m2m tables which point to Document.name
migrations.RemoveField(
model_name='document',
name='formal_languages',
),
migrations.RemoveField(
model_name='document',
name='states',
),
migrations.RemoveField(
model_name='document',
name='tags',
),
# Next (in a separate migration, in order to commit the above before
# we proceed) we'll create the implicit m2m tables again, this time
# pointing to Document.id since that's now the primary key.
]

View file

@ -1,84 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 05:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0018_remove_old_document_field'),
]
operations = [
migrations.AlterModelOptions(
name='documentauthor',
options={'ordering': ['document', 'order']},
),
migrations.RemoveIndex(
model_name='docevent',
name='doc_doceven_type_ac7748_idx',
),
migrations.RenameField(
model_name='docalias',
old_name='document2',
new_name='document',
),
migrations.RenameField(
model_name='docevent',
old_name='doc2',
new_name='doc',
),
migrations.RenameField(
model_name='dochistory',
old_name='doc2',
new_name='doc',
),
migrations.RenameField(
model_name='documentauthor',
old_name='document2',
new_name='document',
),
migrations.RenameField(
model_name='documenturl',
old_name='doc2',
new_name='doc',
),
migrations.RenameField(
model_name='relateddochistory',
old_name='target2',
new_name='target',
),
migrations.RenameField(
model_name='relateddocument',
old_name='source2',
new_name='source',
),
migrations.RenameField(
model_name='relateddocument',
old_name='target2',
new_name='target',
),
migrations.AddIndex(
model_name='docevent',
index=models.Index(fields=['type', 'doc'], name='doc_doceven_type_43e53e_idx'),
),
# Add back the m2m field we removed in 0018_...
migrations.AddField(
model_name='document',
name='formal_languages',
field=models.ManyToManyField(blank=True, help_text='Formal languages used in document', to='name.FormalLanguageName'),
),
migrations.AddField(
model_name='document',
name='states',
field=models.ManyToManyField(blank=True, to='doc.State'),
),
migrations.AddField(
model_name='document',
name='tags',
field=models.ManyToManyField(blank=True, to='name.DocTagName'),
),
]

View file

@ -1,34 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 05:31
import sys, time
from django.db import migrations
def timestamp(apps, schema_editor):
sys.stderr.write('\n %s' % time.strftime('%Y-%m-%d %H:%M:%S'))
class Migration(migrations.Migration):
dependencies = [
('doc', '0019_rename_field_document2'),
]
operations = [
# Copy the doc IDs from the explicit m2m table to the implicit table
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO doc_document_formal_languages SELECT id,document_id,formallanguagename_id FROM doc_documentlanguages;",
""),
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO doc_document_states SELECT id,document_id,state_id FROM doc_documentstates;",
""),
migrations.RunPython(timestamp, timestamp),
migrations.RunSQL(
"INSERT INTO doc_document_tags SELECT id,document_id,doctagname_id FROM doc_documenttags;",
""),
migrations.RunPython(timestamp, timestamp),
]

View file

@ -1,63 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-30 03:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('doc', '0020_copy_docs_m2m_table'),
]
operations = [
# Get rid of the explicit m2m tables which we needed only to be
# able to convert from Document.name to Document.id
migrations.RemoveField(
model_name='documentlanguages',
name='document',
),
migrations.RemoveField(
model_name='documentlanguages',
name='formallanguagename',
),
migrations.RemoveField(
model_name='documentstates',
name='document',
),
migrations.RemoveField(
model_name='documentstates',
name='state',
),
migrations.RemoveField(
model_name='documenttags',
name='doctagname',
),
migrations.RemoveField(
model_name='documenttags',
name='document',
),
migrations.RemoveField(
model_name='document',
name='formal_languages2',
),
migrations.RemoveField(
model_name='document',
name='states2',
),
migrations.RemoveField(
model_name='document',
name='tags2',
),
migrations.DeleteModel(
name='DocumentLanguages',
),
migrations.DeleteModel(
name='DocumentStates',
),
migrations.DeleteModel(
name='DocumentTags',
),
]

View file

@ -1,68 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-06-10 03:47
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
class Migration(migrations.Migration):
dependencies = [
('doc', '0021_remove_docs2_m2m'),
]
operations = [
migrations.AlterField(
model_name='docalias',
name='document',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AlterField(
model_name='docalias',
name='id',
field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='docevent',
name='doc',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AlterField(
model_name='dochistory',
name='doc',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='history_set', to='doc.Document'),
),
migrations.AlterField(
model_name='document',
name='id',
field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='documentauthor',
name='document',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AlterField(
model_name='documenturl',
name='doc',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AlterField(
model_name='relateddochistory',
name='target',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reversely_related_document_history_set', to='doc.DocAlias'),
),
migrations.AlterField(
model_name='relateddocument',
name='source',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document'),
),
migrations.AlterField(
model_name='relateddocument',
name='target',
field=ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.DocAlias'),
),
]

View file

@ -1,43 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-06-10 04:36
import sys
from tqdm import tqdm
from django.db import migrations, models
def forward(apps, schema_editor):
DocAlias = apps.get_model('doc','DocAlias')
sys.stderr.write('\n')
for a in tqdm(DocAlias.objects.all()):
a.docs.add(a.document)
def reverse(apps, schema_editor):
DocAlias = apps.get_model('doc','DocAlias')
sys.stderr.write('\n')
for a in tqdm(DocAlias.objects.all()):
a.document = a.document
a.save()
class Migration(migrations.Migration):
dependencies = [
('doc', '0022_document_primary_key_cleanup'),
]
operations = [
migrations.AddField(
model_name='docalias',
name='docs',
field=models.ManyToManyField(related_name='docalias', to='doc.Document'),
),
migrations.RunPython(forward, reverse),
migrations.RemoveField(
model_name='docalias',
name='document',
),
]

View file

@ -1,59 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-07 12:07
from django.db import migrations
def forward(apps, schema_editor):
StateType = apps.get_model('doc','StateType')
State = apps.get_model('doc','State')
StateType.objects.create(slug='draft-iana-experts',label='IANA Experts State')
State.objects.create(type_id='draft-iana-experts',
slug='need-experts',
name='Need IANA Expert(s)',
used=True,
desc='One or more registries need experts assigned',
order=0
)
State.objects.create(type_id='draft-iana-experts',
slug='reviews-assigned',
name='Reviews assigned',
used=True,
desc='One or more expert reviews have been assigned',
order=1
)
State.objects.create(type_id='draft-iana-experts',
slug='expert-issues',
name='Issues identified',
used=True,
desc='Some expert reviewers have identified issues',
order=2
)
State.objects.create(type_id='draft-iana-experts',
slug='reviewers-ok',
name='Expert Reviews OK',
used=True,
desc='All expert reviews have been completed with no blocking issues',
order=2
)
def reverse(apps, schema_editor):
StateType = apps.get_model('doc','StateType')
State = apps.get_model('doc','State')
State.objects.filter(type_id='draft-iana-experts', slug__in=('need-experts','reviews-assigned','reviews-complete')).delete()
StateType.objects.filter(slug='draft-iana-experts').delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0023_one_to_many_docalias'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,24 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-07 12:27
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('doc', '0024_iana_experts'),
]
operations = [
migrations.CreateModel(
name='IanaExpertDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
],
bases=('doc.docevent',),
),
]

View file

@ -1,24 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from django.db import migrations
def forward(apps, schema_editor):
State = apps.get_model('doc','State')
State.objects.get_or_create(type_id='draft-rfceditor', slug='tooling-issue', name='TI',
desc='Tooling Issue; an update is needed to one or more of the tools in the publication pipeline before this document can be published')
def reverse(apps, schema_editor):
State = apps.get_model('doc','State')
State.objects.filter(type_id='draft-rfceditor', slug='tooling-issue').delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0025_ianaexpertdocevent'),
]
operations = [
migrations.RunPython(forward,reverse)
]

View file

@ -1,62 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-08-03 10:09
from django.db import migrations
# forward, reverse initially copied from migration 0004
def forward(apps, schema_editor):
State = apps.get_model('doc','State')
State.objects.create(type_id='draft-stream-irtf',
slug='irsg_review',
name='IRSG Review',
desc='IRSG Review',
used=True,
)
BallotPositionName = apps.get_model('name','BallotPositionName')
# desc, used, order, and blocking all have suitable defaults
BallotPositionName.objects.create(slug="moretime",
name="Need More Time",
)
BallotPositionName.objects.create(slug="notready",
name="Not Ready",
)
# Create a new ballot type for IRSG ballot
# include positions for the ballot type
BallotType = apps.get_model('doc','BallotType')
bt = BallotType.objects.create(doc_type_id="draft",
slug="irsg-approve",
name="IRSG Approve",
question="Is this draft ready for publication in the IRTF stream?",
)
bt.positions.set(['yes','noobj','recuse','notready','moretime'])
def reverse(apps, schema_editor):
State = apps.get_model('doc','State')
State.objects.filter(type_id__in=('draft-stream-irtf',), slug='irsg_review').delete()
Position = apps.get_model('name','BallotPositionName')
for pos in ("moretime", "notready"):
Position.objects.filter(slug=pos).delete()
IRSGBallot = apps.get_model('doc','BallotType')
IRSGBallot.objects.filter(slug="irsg-approve").delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0026_add_draft_rfceditor_state'),
('name', '0007_fix_m2m_slug_id_length'),
]
operations = [
migrations.RunPython(forward,reverse),
migrations.RenameField(
model_name='ballotpositiondocevent',
old_name='ad',
new_name='balloter',
),
]

View file

@ -1,25 +0,0 @@
# Copyright The IETF Trust 2019-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-10-10 10:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('doc', '0027_add_irsg_doc_positions'),
]
operations = [
migrations.CreateModel(
name='IRSGBallotDocEvent',
fields=[
('ballotdocevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.BallotDocEvent')),
('duedate', models.DateTimeField(blank=True, null=True)),
],
bases=('doc.ballotdocevent',),
),
]

View file

@ -1,21 +0,0 @@
# Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-17 11:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0028_irsgballotdocevent'),
]
operations = [
migrations.AlterField(
model_name='docevent',
name='type',
field=models.CharField(choices=[('new_revision', 'Added new revision'), ('new_submission', 'Uploaded new revision'), ('changed_document', 'Changed document metadata'), ('added_comment', 'Added comment'), ('added_message', 'Added message'), ('edited_authors', 'Edited the documents author list'), ('deleted', 'Deleted document'), ('changed_state', 'Changed state'), ('changed_stream', 'Changed document stream'), ('expired_document', 'Expired document'), ('extended_expiry', 'Extended expiry of document'), ('requested_resurrect', 'Requested resurrect'), ('completed_resurrect', 'Completed resurrect'), ('changed_consensus', 'Changed consensus'), ('published_rfc', 'Published RFC'), ('added_suggested_replaces', 'Added suggested replacement relationships'), ('reviewed_suggested_replaces', 'Reviewed suggested replacement relationships'), ('changed_group', 'Changed group'), ('changed_protocol_writeup', 'Changed protocol writeup'), ('changed_charter_milestone', 'Changed charter milestone'), ('initial_review', 'Set initial review time'), ('changed_review_announcement', 'Changed WG Review text'), ('changed_action_announcement', 'Changed WG Action text'), ('started_iesg_process', 'Started IESG process on document'), ('created_ballot', 'Created ballot'), ('closed_ballot', 'Closed ballot'), ('sent_ballot_announcement', 'Sent ballot announcement'), ('changed_ballot_position', 'Changed ballot position'), ('changed_ballot_approval_text', 'Changed ballot approval text'), ('changed_ballot_writeup_text', 'Changed ballot writeup text'), ('changed_rfc_editor_note_text', 'Changed RFC Editor Note text'), ('changed_last_call_text', 'Changed last call text'), ('requested_last_call', 'Requested last call'), ('sent_last_call', 'Sent last call'), ('scheduled_for_telechat', 'Scheduled for telechat'), ('iesg_approved', 'IESG approved document (no problem)'), ('iesg_disapproved', 'IESG disapproved document (do not publish)'), ('approved_in_minute', 'Approved in minute'), ('iana_review', 'IANA review comment'), ('rfc_in_iana_registry', 'RFC is in IANA registry'), ('rfc_editor_received_announcement', 'Announcement was received by RFC Editor'), ('requested_publication', 'Publication at RFC Editor requested'), ('sync_from_rfc_editor', 'Received updated information from RFC Editor'), ('requested_review', 'Requested review'), ('assigned_review_request', 'Assigned review request'), ('closed_review_request', 'Closed review request'), ('closed_review_assignment', 'Closed review assignment'), ('downref_approved', 'Downref approved'), ('posted_related_ipr', 'Posted related IPR'), ('removed_related_ipr', 'Removed related IPR')], max_length=50),
),
]

View file

@ -1,37 +0,0 @@
# Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-21 14:27
from __future__ import absolute_import, print_function, unicode_literals
import re
from django.conf import settings
from django.db import migrations
def forward(apps, schema_editor):
Document = apps.get_model('doc', 'Document')
print('')
for d in Document.objects.filter(external_url__contains="/b'"):
match = re.search("^(%s/arch/msg/[^/]+/)b'([^']+)'$" % settings.MAILING_LIST_ARCHIVE_URL, d.external_url)
if match:
d.external_url = "%s%s" % (match.group(1), match.group(2))
d.save()
print('Fixed url #%s: %s' % (d.id, d.external_url))
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('doc', '0029_add_ipr_event_types'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,42 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright The IETF Trust 2020, All Rights Reserved
# Generated by Django 1.11.28 on 2020-03-03 13:54
from __future__ import unicode_literals
from django.db import migrations
def forward(apps, schema_editor):
Person = apps.get_model('person', 'Person')
Document = apps.get_model('doc','Document')
State = apps.get_model('doc','State')
BallotDocEvent = apps.get_model('doc','BallotDocEvent')
replaced_state = State.objects.create(type_id='charter', slug='replaced', name='Replaced', used=True, desc="This charter's group was replaced.", order = 0)
by = Person.objects.get(name='(System)')
for doc in Document.objects.filter(type_id='charter',states__type_id='charter',states__slug__in=['intrev','extrev'],group__state='replaced'):
doc.states.remove(*list(doc.states.filter(type_id='charter')))
doc.states.add(replaced_state)
ballot = BallotDocEvent.objects.filter(doc=doc, type__in=('created_ballot', 'closed_ballot')).order_by('-time', '-id').first()
if ballot and ballot.type == 'created_ballot':
e = BallotDocEvent(type="closed_ballot", doc=doc, rev=doc.rev, by=by)
e.ballot_type = ballot.ballot_type
e.desc = 'Closed "%s" ballot' % e.ballot_type.name
e.save()
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('doc', '0030_fix_bytes_mailarch_url'),
('person', '0009_auto_20190118_0725'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,23 +0,0 @@
# Generated by Django 2.1.15 on 2020-06-24 13:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0031_set_state_for_charters_of_replaced_groups'),
]
operations = [
migrations.AlterField(
model_name='ballotpositiondocevent',
name='send_email',
field=models.BooleanField(default=None, null=True),
),
migrations.AlterField(
model_name='consensusdocevent',
name='consensus',
field=models.BooleanField(default=None, null=True),
),
]

View file

@ -1,67 +0,0 @@
# Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django.db.models import OuterRef, Subquery
from re import match
def forward(apps, schema_editor):
"""Add DocumentURLs for docs in the Auth48 state
Checks the latest StateDocEvent; if it is in the auth48 state and the
event desc has an AUTH48 link, creates an auth48 DocumentURL for that doc.
"""
Document = apps.get_model('doc', 'Document')
StateDocEvent = apps.get_model('doc', 'StateDocEvent')
DocumentURL = apps.get_model('doc', 'DocumentURL')
# Regex - extracts auth48 URL as first match group
pattern = r'RFC Editor state changed to <a href="(.*)"><b>AUTH48.*</b></a>.*'
# To avoid 100k queries, set up a subquery to find the latest StateDocEvent for each doc...
latest_events = StateDocEvent.objects.filter(doc=OuterRef('pk')).order_by('-time', '-id')
# ... then annotate the doc list with that and select only those in the auth48 state...
auth48_docs = Document.objects.annotate(
current_state_slug=Subquery(latest_events.values('state__slug')[:1])
).filter(current_state_slug='auth48')
# ... and add an auth48 DocumentURL if one is found.
for doc in auth48_docs:
# Retrieve the full StateDocEvent. Results in a query per doc, but
# only for the few few in the auth48 state.
sde = StateDocEvent.objects.filter(doc=doc).order_by('-time', '-id').first()
urlmatch = match(pattern, sde.desc) # Auth48 URL is usually in the event desc
if urlmatch is not None:
DocumentURL.objects.create(doc=doc, tag_id='auth48', url=urlmatch[1])
# Validate the migration using a different approach to find auth48 docs.
# This is slower than above, but still avoids querying for every Document.
auth48_events = StateDocEvent.objects.filter(state__slug='auth48')
for a48_event in auth48_events:
doc = a48_event.doc
latest_sde = StateDocEvent.objects.filter(doc=doc).order_by('-time', '-id').first()
if latest_sde.state and latest_sde.state.slug == 'auth48' and match(pattern, latest_sde.desc) is not None:
# Currently in the auth48 state with a URL
assert doc.documenturl_set.filter(tag_id='auth48').count() == 1
else:
# Either no longer in auth48 state or had no URL
assert doc.documenturl_set.filter(tag_id='auth48').count() == 0
def reverse(apps, schema_editor):
"""Remove any auth48 DocumentURLs - these did not exist before"""
DocumentURL = apps.get_model('doc', 'DocumentURL')
DocumentURL.objects.filter(tag_id='auth48').delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0032_auto_20200624_1332'),
('name', '0013_add_auth48_docurltagname'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,28 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-04-15 10:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
class Migration(migrations.Migration):
dependencies = [
('name', '0014_extres'),
('doc', '0033_populate_auth48_urls'),
]
operations = [
migrations.CreateModel(
name='DocExtResource',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('display_name', models.CharField(blank=True, default='', max_length=255)),
('value', models.CharField(max_length=2083)),
('doc', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='name.ExtResourceName')),
],
),
]

View file

@ -1,125 +0,0 @@
# Copyright The IETF Trust 2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-03-19 13:06
from __future__ import unicode_literals
import re
import debug # pyflakes:ignore
from collections import OrderedDict, Counter
from io import StringIO
from django.db import migrations
from ietf.utils.validators import validate_external_resource_value
from django.core.exceptions import ValidationError
name_map = {
"Issue.*": "tracker",
".*FAQ.*": "faq",
".*Area Web Page": "webpage",
".*Wiki": "wiki",
"Home Page": "webpage",
"Slack.*": "slack",
"Additional .* Web Page": "webpage",
"Additional .* Page": "webpage",
"Yang catalog entry.*": "yc_entry",
"Yang impact analysis.*": "yc_impact",
"GitHub": "github_repo",
"Github page": "github_repo",
"GitHub repo.*": "github_repo",
"Github repository.*": "github_repo",
"GitHub org.*": "github_org",
"GitHub User.*": "github_username",
"GitLab User": "gitlab_username",
"GitLab User Name": "gitlab_username",
}
url_map = OrderedDict({
"https?://github\\.com": "github_repo",
"https://git.sr.ht/": "repo",
"https://todo.sr.ht/": "tracker",
"https?://trac\\.ietf\\.org/.*/wiki": "wiki",
"ietf\\.org.*/trac/wiki": "wiki",
"trac.*wiki": "wiki",
"www\\.ietf\\.org/mailman" : None,
"www\\.ietf\\.org/mail-archive" : None,
"mailarchive\\.ietf\\.org" : None,
"ietf\\.org/logs": "jabber_log",
"ietf\\.org/jabber/logs": "jabber_log",
"xmpp:.*?join": "jabber_room",
"bell-labs\\.com": None,
"html\\.charters": None,
"datatracker\\.ietf\\.org": None,
})
def forward(apps, schema_editor):
DocExtResource = apps.get_model('doc', 'DocExtResource')
ExtResourceName = apps.get_model('name', 'ExtResourceName')
DocumentUrl = apps.get_model('doc', 'DocumentUrl')
stats = Counter()
stats_file = StringIO()
for doc_url in DocumentUrl.objects.all():
doc_url.url = doc_url.url.strip()
match_found = False
for regext,slug in name_map.items():
if re.fullmatch(regext, doc_url.desc):
match_found = True
stats['mapped'] += 1
name = ExtResourceName.objects.get(slug=slug)
try:
validate_external_resource_value(name, doc_url.url)
DocExtResource.objects.create(doc=doc_url.doc, name_id=slug, value=doc_url.url, display_name=doc_url.desc)
except ValidationError as e: # pyflakes:ignore
print("Failed validation:", doc_url.url, e, file=stats_file)
stats['failed_validation'] +=1
break
if not match_found:
for regext, slug in url_map.items():
if re.search(regext, doc_url.url):
match_found = True
if slug:
stats['mapped'] +=1
name = ExtResourceName.objects.get(slug=slug)
# Munge the URL if it's the first github repo match
# Remove "/tree/master" substring if it exists
# Remove trailing "/issues" substring if it exists
# Remove "/blob/master/.*" pattern if present
if regext == "https?://github\\.com":
doc_url.url = doc_url.url.replace("/tree/master","")
doc_url.url = re.sub('/issues$', '', doc_url.url)
doc_url.url = re.sub('/blob/master.*$', '', doc_url.url)
try:
validate_external_resource_value(name, doc_url.url)
DocExtResource.objects.create(doc=doc_url.doc, name=name, value=doc_url.url, display_name=doc_url.desc)
except ValidationError as e: # pyflakes:ignore
print("Failed validation:", doc_url.url, e, file=stats_file)
stats['failed_validation'] +=1
else:
stats['ignored'] +=1
break
if not match_found:
print("Not Mapped:", doc_url.desc, doc_url.tag.slug, doc_url.doc.name, doc_url.url, file=stats_file)
stats['not_mapped'] += 1
print('')
print(stats_file.getvalue())
print (stats)
def reverse(apps, schema_editor):
DocExtResource = apps.get_model('doc', 'DocExtResource')
DocExtResource.objects.all().delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0034_extres'),
('name', '0015_populate_extres'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,34 +0,0 @@
# Copyright The IETF Trust 2020, All Rights Reserved
from urllib.parse import urlparse
from django.db import migrations
def categorize(url):
# This will categorize a few urls pointing into files in a repo as a repo, but that's better than calling them an org
element_count = len(urlparse(url).path.strip('/').split('/'))
if element_count < 1:
print("Bad github resource:",url)
return 'github_org' if element_count == 1 else 'github_repo'
def forward(apps, schema_editor):
DocExtResource = apps.get_model('doc','DocExtResource')
for resource in DocExtResource.objects.filter(name__slug__in=('github_org','github_repo')):
category = categorize(resource.value)
if resource.name_id != category:
resource.name_id = category
resource.save()
def reverse(apps, schema_editor):
# Intentionally don't try to return to former worse state
pass
class Migration(migrations.Migration):
dependencies = [
('doc', '0035_populate_docextresources'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,29 +0,0 @@
# Generated by Django 2.2.16 on 2020-09-22 07:58
from django.db import migrations
def forward(apps, schema_editor):
Document = apps.get_model('doc', 'Document')
DocAlias = apps.get_model('doc', 'DocAlias')
docs_without_alias = Document.objects.filter(docalias__isnull=True)
bad_aliases = DocAlias.objects.filter(name__in=docs_without_alias.values_list('name'))
bad_aliases.delete()
for doc in docs_without_alias:
DocAlias.objects.create(name=doc.name).docs.add(doc)
def reverse(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
('doc', '0036_orgs_vs_repos'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,17 +0,0 @@
# Generated by Django 2.2.17 on 2020-11-09 04:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0037_clean_up_missing_docaliases'),
]
operations = [
migrations.AddIndex(
model_name='docevent',
index=models.Index(fields=['-time', '-id'], name='doc_doceven_time_1a258f_idx'),
),
]

View file

@ -1,21 +0,0 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0038_auto_20201109_0429'),
]
operations = [
migrations.AddIndex(
model_name='dochistoryauthor',
index=models.Index(fields=['document', 'order'], name='doc_dochist_documen_7e2441_idx'),
),
migrations.AddIndex(
model_name='documentauthor',
index=models.Index(fields=['document', 'order'], name='doc_documen_documen_7fabe2_idx'),
),
]

View file

@ -1,19 +0,0 @@
# Generated by Django 2.2.17 on 2021-01-15 12:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('group', '0040_lengthen_used_roles_fields'), # only needed for schema vs data ordering
('doc', '0039_auto_20201109_0439'),
]
operations = [
migrations.AlterField(
model_name='docevent',
name='type',
field=models.CharField(choices=[('new_revision', 'Added new revision'), ('new_submission', 'Uploaded new revision'), ('changed_document', 'Changed document metadata'), ('added_comment', 'Added comment'), ('added_message', 'Added message'), ('edited_authors', 'Edited the documents author list'), ('deleted', 'Deleted document'), ('changed_state', 'Changed state'), ('changed_stream', 'Changed document stream'), ('expired_document', 'Expired document'), ('extended_expiry', 'Extended expiry of document'), ('requested_resurrect', 'Requested resurrect'), ('completed_resurrect', 'Completed resurrect'), ('changed_consensus', 'Changed consensus'), ('published_rfc', 'Published RFC'), ('added_suggested_replaces', 'Added suggested replacement relationships'), ('reviewed_suggested_replaces', 'Reviewed suggested replacement relationships'), ('changed_action_holders', 'Changed action holders for document'), ('changed_group', 'Changed group'), ('changed_protocol_writeup', 'Changed protocol writeup'), ('changed_charter_milestone', 'Changed charter milestone'), ('initial_review', 'Set initial review time'), ('changed_review_announcement', 'Changed WG Review text'), ('changed_action_announcement', 'Changed WG Action text'), ('started_iesg_process', 'Started IESG process on document'), ('created_ballot', 'Created ballot'), ('closed_ballot', 'Closed ballot'), ('sent_ballot_announcement', 'Sent ballot announcement'), ('changed_ballot_position', 'Changed ballot position'), ('changed_ballot_approval_text', 'Changed ballot approval text'), ('changed_ballot_writeup_text', 'Changed ballot writeup text'), ('changed_rfc_editor_note_text', 'Changed RFC Editor Note text'), ('changed_last_call_text', 'Changed last call text'), ('requested_last_call', 'Requested last call'), ('sent_last_call', 'Sent last call'), ('scheduled_for_telechat', 'Scheduled for telechat'), ('iesg_approved', 'IESG approved document (no problem)'), ('iesg_disapproved', 'IESG disapproved document (do not publish)'), ('approved_in_minute', 'Approved in minute'), ('iana_review', 'IANA review comment'), ('rfc_in_iana_registry', 'RFC is in IANA registry'), ('rfc_editor_received_announcement', 'Announcement was received by RFC Editor'), ('requested_publication', 'Publication at RFC Editor requested'), ('sync_from_rfc_editor', 'Received updated information from RFC Editor'), ('requested_review', 'Requested review'), ('assigned_review_request', 'Assigned review request'), ('closed_review_request', 'Closed review request'), ('closed_review_assignment', 'Closed review assignment'), ('downref_approved', 'Downref approved'), ('posted_related_ipr', 'Posted related IPR'), ('removed_related_ipr', 'Removed related IPR')], max_length=50),
),
]

View file

@ -1,35 +0,0 @@
# Generated by Django 2.2.17 on 2021-01-15 12:50
import datetime
from django.db import migrations, models
import django.db.models.deletion
import ietf.utils.models
class Migration(migrations.Migration):
dependencies = [
('person', '0018_auto_20201109_0439'),
('doc', '0040_add_changed_action_holders_docevent_type'),
]
operations = [
migrations.CreateModel(
name='DocumentActionHolder',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('time_added', models.DateTimeField(default=datetime.datetime.now)),
('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document')),
('person', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='person.Person')),
],
),
migrations.AddField(
model_name='document',
name='action_holders',
field=models.ManyToManyField(blank=True, through='doc.DocumentActionHolder', to='person.Person'),
),
migrations.AddConstraint(
model_name='documentactionholder',
constraint=models.UniqueConstraint(fields=('document', 'person'), name='unique_action_holder'),
),
]

View file

@ -1,36 +0,0 @@
# Copyright The IETF Trust 2021 All Rights Reserved
# Generated by Django 2.2.23 on 2021-05-21 13:29
from django.db import migrations
def forward(apps, schema_editor):
StateType = apps.get_model('doc', 'StateType')
State = apps.get_model('doc', 'State')
StateType.objects.create(slug='bofreq', label='BOF Request State')
proposed = State.objects.create(type_id='bofreq', slug='proposed', name='Proposed', used=True, desc='The BOF request is proposed', order=0)
approved = State.objects.create(type_id='bofreq', slug='approved', name='Approved', used=True, desc='The BOF request is approved', order=1)
declined = State.objects.create(type_id='bofreq', slug='declined', name='Declined', used=True, desc='The BOF request is declined', order=2)
replaced = State.objects.create(type_id='bofreq', slug='replaced', name='Replaced', used=True, desc='The BOF request is proposed', order=3)
abandoned = State.objects.create(type_id='bofreq', slug='abandoned', name='Abandoned', used=True, desc='The BOF request is abandoned', order=4)
proposed.next_states.set([approved,declined,replaced,abandoned])
def reverse(apps, schema_editor):
StateType = apps.get_model('doc', 'StateType')
State = apps.get_model('doc', 'State')
State.objects.filter(type_id='bofreq').delete()
StateType.objects.filter(slug='bofreq').delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0041_add_documentactionholder'),
('name', '0027_add_bofrequest'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,36 +0,0 @@
# Generated by Django 2.2.24 on 2021-07-06 13:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('person', '0019_auto_20210604_1443'),
('doc', '0042_bofreq_states'),
]
operations = [
migrations.AlterField(
model_name='docevent',
name='type',
field=models.CharField(choices=[('new_revision', 'Added new revision'), ('new_submission', 'Uploaded new revision'), ('changed_document', 'Changed document metadata'), ('added_comment', 'Added comment'), ('added_message', 'Added message'), ('edited_authors', 'Edited the documents author list'), ('deleted', 'Deleted document'), ('changed_state', 'Changed state'), ('changed_stream', 'Changed document stream'), ('expired_document', 'Expired document'), ('extended_expiry', 'Extended expiry of document'), ('requested_resurrect', 'Requested resurrect'), ('completed_resurrect', 'Completed resurrect'), ('changed_consensus', 'Changed consensus'), ('published_rfc', 'Published RFC'), ('added_suggested_replaces', 'Added suggested replacement relationships'), ('reviewed_suggested_replaces', 'Reviewed suggested replacement relationships'), ('changed_action_holders', 'Changed action holders for document'), ('changed_group', 'Changed group'), ('changed_protocol_writeup', 'Changed protocol writeup'), ('changed_charter_milestone', 'Changed charter milestone'), ('initial_review', 'Set initial review time'), ('changed_review_announcement', 'Changed WG Review text'), ('changed_action_announcement', 'Changed WG Action text'), ('started_iesg_process', 'Started IESG process on document'), ('created_ballot', 'Created ballot'), ('closed_ballot', 'Closed ballot'), ('sent_ballot_announcement', 'Sent ballot announcement'), ('changed_ballot_position', 'Changed ballot position'), ('changed_ballot_approval_text', 'Changed ballot approval text'), ('changed_ballot_writeup_text', 'Changed ballot writeup text'), ('changed_rfc_editor_note_text', 'Changed RFC Editor Note text'), ('changed_last_call_text', 'Changed last call text'), ('requested_last_call', 'Requested last call'), ('sent_last_call', 'Sent last call'), ('scheduled_for_telechat', 'Scheduled for telechat'), ('iesg_approved', 'IESG approved document (no problem)'), ('iesg_disapproved', 'IESG disapproved document (do not publish)'), ('approved_in_minute', 'Approved in minute'), ('iana_review', 'IANA review comment'), ('rfc_in_iana_registry', 'RFC is in IANA registry'), ('rfc_editor_received_announcement', 'Announcement was received by RFC Editor'), ('requested_publication', 'Publication at RFC Editor requested'), ('sync_from_rfc_editor', 'Received updated information from RFC Editor'), ('requested_review', 'Requested review'), ('assigned_review_request', 'Assigned review request'), ('closed_review_request', 'Closed review request'), ('closed_review_assignment', 'Closed review assignment'), ('downref_approved', 'Downref approved'), ('posted_related_ipr', 'Posted related IPR'), ('removed_related_ipr', 'Removed related IPR'), ('changed_editors', 'Changed BOF Request editors')], max_length=50),
),
migrations.CreateModel(
name='BofreqResponsibleDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
('responsible', models.ManyToManyField(blank=True, to='person.Person')),
],
bases=('doc.docevent',),
),
migrations.CreateModel(
name='BofreqEditorDocEvent',
fields=[
('docevent_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='doc.DocEvent')),
('editors', models.ManyToManyField(blank=True, to='person.Person')),
],
bases=('doc.docevent',),
),
]

View file

@ -1,34 +0,0 @@
# Copyright The IETF Trust 2021 All Rights Reserved
# Generated by Django 2.2.23 on 2021-05-21 13:29
from django.db import migrations
def forward(apps, schema_editor):
StateType = apps.get_model('doc', 'StateType')
State = apps.get_model('doc', 'State')
StateType.objects.create(slug='procmaterials', label='Proceedings Materials State')
active = State.objects.create(type_id='procmaterials', slug='active', name='Active', used=True, desc='The material is active', order=0)
removed = State.objects.create(type_id='procmaterials', slug='removed', name='Removed', used=True, desc='The material is removed', order=1)
active.next_states.set([removed])
removed.next_states.set([active])
def reverse(apps, schema_editor):
StateType = apps.get_model('doc', 'StateType')
State = apps.get_model('doc', 'State')
State.objects.filter(type_id='procmaterials').delete()
StateType.objects.filter(slug='procmaterials').delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0043_bofreq_docevents'),
('name', '0031_add_procmaterials'),
]
operations = [
migrations.RunPython(forward, reverse)
]

View file

@ -1,34 +0,0 @@
# Copyright The IETF Trust 2022, All Rights Reserved
from django.db import migrations
def forward(apps, schema_editor):
StateType = apps.get_model("doc", "StateType")
State = apps.get_model("doc", "State")
for slug in ("chatlog", "polls"):
StateType.objects.create(slug=slug, label="State")
for state_slug in ("active", "deleted"):
State.objects.create(
type_id = slug,
slug = state_slug,
name = state_slug.capitalize(),
used = True,
desc = "",
order = 0,
)
def reverse(apps, schema_editor):
StateType = apps.get_model("doc", "StateType")
State = apps.get_model("doc", "State")
State.objects.filter(type_id__in=("chatlog", "polls")).delete()
StateType.objects.filter(slug__in=("chatlog", "polls")).delete()
class Migration(migrations.Migration):
dependencies = [
('doc', '0044_procmaterials_states'),
('name', '0045_polls_and_chatlogs'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,39 +0,0 @@
# Generated by Django 2.2.28 on 2022-07-12 11:24
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('doc', '0045_docstates_chatlogs_polls'),
]
operations = [
migrations.AlterField(
model_name='deletedevent',
name='time',
field=models.DateTimeField(default=django.utils.timezone.now),
),
migrations.AlterField(
model_name='docevent',
name='time',
field=models.DateTimeField(db_index=True, default=django.utils.timezone.now, help_text='When the event happened'),
),
migrations.AlterField(
model_name='dochistory',
name='time',
field=models.DateTimeField(default=django.utils.timezone.now),
),
migrations.AlterField(
model_name='document',
name='time',
field=models.DateTimeField(default=django.utils.timezone.now),
),
migrations.AlterField(
model_name='documentactionholder',
name='time_added',
field=models.DateTimeField(default=django.utils.timezone.now),
),
]

View file

@ -1,61 +0,0 @@
# Generated by Django 2.2.28 on 2022-08-31 20:26
import datetime
import json
from zoneinfo import ZoneInfo
from django.db import migrations
TZ_BEFORE = ZoneInfo('PST8PDT')
def forward(apps, schema_editor):
DeletedEvent = apps.get_model('doc', 'DeletedEvent')
for deleted_event in DeletedEvent.objects.all():
fields = json.loads(deleted_event.json)
replacements = {}
for k, v in fields.items():
if isinstance(v, str):
try:
dt = datetime.datetime.strptime(v, '%Y-%m-%d %H:%M:%S')
except:
pass
else:
replacements[k] = dt.replace(tzinfo=TZ_BEFORE).astimezone(datetime.timezone.utc).isoformat()
if len(replacements) > 0:
fields.update(replacements)
deleted_event.json = json.dumps(fields)
deleted_event.save()
def reverse(apps, schema_editor):
DeletedEvent = apps.get_model('doc', 'DeletedEvent')
for deleted_event in DeletedEvent.objects.all():
fields = json.loads(deleted_event.json)
replacements = {}
for k, v in fields.items():
if isinstance(v, str) and 'T' in v:
try:
dt = datetime.datetime.fromisoformat(v)
except:
pass
else:
replacements[k] = dt.astimezone(TZ_BEFORE).replace(tzinfo=None).strftime('%Y-%m-%d %H:%M:%S')
if len(replacements) > 0:
fields.update(replacements)
deleted_event.json = json.dumps(fields)
deleted_event.save()
class Migration(migrations.Migration):
dependencies = [
('doc', '0046_use_timezone_now_for_doc_models'),
('utils', '0003_pause_to_change_use_tz'),
]
operations = [
migrations.RunPython(forward, reverse),
]

View file

@ -1,23 +0,0 @@
# Generated by Django 2.2.28 on 2022-12-05 17:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('doc', '0047_tzaware_deletedevents'),
]
operations = [
migrations.AlterField(
model_name='dochistory',
name='notify',
field=models.TextField(blank=True, max_length=1023),
),
migrations.AlterField(
model_name='document',
name='notify',
field=models.TextField(blank=True, max_length=1023),
),
]

View file

@ -1,51 +0,0 @@
# Copyright The IETF Trust 2022, All Rights Reserved
# -*- coding: utf-8 -*-
from django.db import migrations
def forward(apps, schema_editor):
State = apps.get_model("doc", "State")
State.objects.create(
type_id="draft-stream-editorial",
slug="rsab_review",
name="RSAB Review",
desc="RSAB Review",
used=True,
)
BallotPositionName = apps.get_model("name", "BallotPositionName")
BallotPositionName.objects.create(slug="concern", name="Concern", blocking=True)
BallotType = apps.get_model("doc", "BallotType")
bt = BallotType.objects.create(
doc_type_id="draft",
slug="rsab-approve",
name="RSAB Approve",
question="Is this draft ready for publication in the Editorial stream?",
)
bt.positions.set(
["yes", "concern", "recuse"]
) # See RFC9280 section 3.2.2 list item 9.
def reverse(apps, schema_editor):
State = apps.get_model("doc", "State")
State.objects.filter(type_id="draft-stream-editorial", slug="rsab_review").delete()
Position = apps.get_model("name", "BallotPositionName")
Position.objects.filter(slug="concern").delete()
BallotType = apps.get_model("doc", "BallotType")
BallotType.objects.filter(slug="irsg-approve").delete()
class Migration(migrations.Migration):
dependencies = [
("doc", "0048_allow_longer_notify"),
("name", "0045_polls_and_chatlogs"),
]
operations = [
migrations.RunPython(forward, reverse),
]

Some files were not shown because too many files have changed in this diff Show more