pyalchemybiz/pyalchemybiz/productdb.py

21 lines
578 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
#
# Package pyalchemybiz
#
# Author: Jan Dittberner <jan@dittberner.info>
# Version: $Id$
#
# This file is part of pyalchemybiz
from sqlalchemy import *
def create_schema(metadata):
"""Create the database schema for products."""
product_table = Table(
'product', metadata,
Column('product_id', Integer, primary_key=True),
Column('name', String(100), nullable=False),
Column('description', String(4096), nullable=False),
Column('product_type', Integer, nullable=False)
)
product_table.create()