# Generated by Django 3.1.3 on 2021-09-20 08:22


# Disclaimer
# ----------
#
# Copyright (C) 2021 Helmholtz-Zentrum Hereon
# Copyright (C) 2020-2021 Helmholtz-Zentrum Geesthacht
#
# This file is part of django-academic-community and is released under the
# EUPL-1.2 license.
# See LICENSE in the root of the repository for full licensing details.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the EUROPEAN UNION PUBLIC LICENCE v. 1.2 or later
# as published by the European Commission.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# EUPL-1.2 license for more details.
#
# You should have received a copy of the EUPL-1.2 license along with this
# program. If not, see https://www.eupl.eu/.


import django.db.models.deletion
import private_storage.fields
import private_storage.storage.files
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("programme", "0005_session_description"),
    ]

    operations = [
        migrations.CreateModel(
            name="SessionMaterial",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="Display text for the material",
                        max_length=200,
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="Date when the material has been uploaded.",
                    ),
                ),
                (
                    "last_modification_date",
                    models.DateTimeField(
                        auto_now=True,
                        help_text="Date when the material has last been modified.",
                    ),
                ),
                (
                    "upload_material",
                    private_storage.fields.PrivateFileField(
                        blank=True,
                        help_text="Material to upload, max. 25MB. Uploaded Material is only accessible to community members.",
                        null=True,
                        storage=private_storage.storage.files.PrivateFileSystemStorage(),
                        upload_to="sessionmaterial/",
                    ),
                ),
                (
                    "external_url",
                    models.URLField(
                        blank=True,
                        help_text="External URL for this material.",
                        null=True,
                    ),
                ),
                (
                    "session",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="programme.session",
                    ),
                ),
            ],
        ),
    ]
