text: # -*- coding: utf-8 -*-
  # Generated by Django 1.11.11 on 2018-03-21 21:13
  from __future__ import unicode_literals
  
  from django.db import migrations
  
  
  class Migration(migrations.Migration):
  
      dependencies = [("networktoken", "0002_token_purpose")]
  
      forward = [
          """
          CREATE SCHEMA "radius";
          """,
          """
          CREATE OR REPLACE VIEW "radius"."token" AS SELECT
              n.id AS id,
              'guest_' || n.id::varchar AS UserName,
              'Cleartext-Password'::varchar AS Attribute,
              ':=' AS op,
              n.value AS Value
          FROM
              "public"."networktoken_token" n
          WHERE n.created + n.lifetime > NOW();
          """,
          """
          CREATE TABLE "radius"."reply" (
              id serial PRIMARY KEY,
              UserName text NOT NULL DEFAULT '',
              Attribute text NOT NULL DEFAULT '',
              op VARCHAR(2) NOT NULL DEFAULT '=',
              Value text NOT NULL DEFAULT ''
          );
          """,
      ]
  
      reverse = [
          """
          DROP VIEW "radius"."token";
          """,
          """
          DROP TABLE "radius"."reply";
          """,
          """
          DROP SCHEMA "radius";
          """,
      ]
  
      operations = [migrations.RunSQL(forward, reverse)]
  