old_contents: # Licensed under the Apache License, Version 2.0 (the "License"); you may
  # not use this file except in compliance with the License. You may obtain
  # a copy of the License at
  #
  #      http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  # License for the specific language governing permissions and limitations
  # under the License.
  
  import functools
  
  import flask_sqlalchemy
  
  db = flask_sqlalchemy.SQLAlchemy()
  pk_type = db.Integer
  pk = functools.partial(db.Column, pk_type, primary_key=True)
  
  
  class Namespace(db.Model):
      id = pk()
      name = db.Column(db.String(128))
  
  # Component registry
  
  
  class Component(db.Model):
      id = pk()
      name = db.Column(db.String(128))
      schemas = db.relationship("Schema", backref="component")
      templates = db.relationship("Template", backref="component")
  
  
  class Schema(db.Model):
      id = pk()
      name = db.Column(db.String(128))
      component_id = db.Column(pk_type, db.ForeignKey(Component.id))
      namespace_id = db.Column(pk_type, db.ForeignKey(Namespace.id))
      content = db.Column(db.Text)
  
  
  class Template(db.Model):
      id = pk()
      name = db.Column(db.String(128))
      component_id = db.Column(pk_type, db.ForeignKey(Component.id))
      content = db.Column(db.Text)
  
  # Environment data storage
  
  _environment_components = db.Table(
      'environment_components',
      db.Column('environment_id', pk_type, db.ForeignKey('environment.id')),
      db.Column('component_id', pk_type, db.ForeignKey('component.id')),
  )
  
  
  class Environment(db.Model):
      id = pk()
      components = db.relationship(Component, secondary=_environment_components)
  
  
  class TemplateInstance(db.Model):
      id = pk()
      template_id = db.Column(pk_type, db.ForeignKey(Template.id))
      environment_id = db.Column(pk_type, db.ForeignKey(Environment.id))
      content = db.Column(db.Text)
  
  
  class NamespaceInstance(db.Model):
      id = pk()
      namespace_id = db.Column(pk_type, db.ForeignKey(Namespace.id))
      environment_id = db.Column(pk_type, db.ForeignKey(Environment.id))
  
new_contents: # Licensed under the Apache License, Version 2.0 (the "License"); you may
  # not use this file except in compliance with the License. You may obtain
  # a copy of the License at
  #
  #      http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  # License for the specific language governing permissions and limitations
  # under the License.
  
  import functools
  
  import flask_sqlalchemy
  
  db = flask_sqlalchemy.SQLAlchemy()
  pk_type = db.Integer
  pk = functools.partial(db.Column, pk_type, primary_key=True)
  
  
  class Namespace(db.Model):
      id = pk()
      name = db.Column(db.String(128))
  
  # Component registry
  
  
  class Component(db.Model):
      id = pk()
      name = db.Column(db.String(128))
      schemas = db.relationship("Schema", backref="component")
      templates = db.relationship("Template", backref="component")
  
  
  class Schema(db.Model):
      id = pk()
      name = db.Column(db.String(128))
      component_id = db.Column(pk_type, db.ForeignKey(Component.id))
      namespace_id = db.Column(pk_type, db.ForeignKey(Namespace.id))
      content = db.Column(db.Text)
  
  
  class Template(db.Model):
      id = pk()
      name = db.Column(db.String(128))
      component_id = db.Column(pk_type, db.ForeignKey(Component.id))
      content = db.Column(db.Text)
  
  # Environment data storage
  
  _environment_components = db.Table(
      'environment_components',
      db.Column('environment_id', pk_type, db.ForeignKey('environment.id')),
      db.Column('component_id', pk_type, db.ForeignKey('component.id')),
  )
  
  
  class Environment(db.Model):
      id = pk()
      components = db.relationship(Component, secondary=_environment_components)
  
subject: Cut unused models for now