Beispiel #1
0
    def perform(self, args):
        opts = self.parse_args(args)
        if userquery('ATENTION: This command will delete any project tables at'\
                   ' database server.\nWould you like yo continue?')=='no':
            print '\nQuitting.'
            sys.exit(1)
        print '\n' + bold('Creating tables...')
        gen = Generator(opts['verbose'])
        gen.generate_database()
        tables = gen.get_database()
        db = Database()
        db.connect()

        for table in tables:
            if opts['verbose']:
                print bold('Creating table {0}...'.format(table['name']))
            db.create(table['script'])

        print bold('Database created successfully.')
Beispiel #2
0
    def perform(self, args):
        opts=self.parse_args(args)
        if userquery('ATENTION: This command will delete any project tables at'\
                   ' database server.\nWould you like yo continue?')=='no':
            print '\nQuitting.'
            sys.exit(1)
        print '\n'+bold('Creating tables...')
        gen=Generator(opts['verbose'])
        gen.generate_database()
        tables=gen.get_database()
        db=Database()
        db.connect()

        for table in tables:
            if opts['verbose']:
                print bold('Creating table {0}...'.format(table['name']))
            db.create(table['script'])

        print bold('Database created successfully.')