<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_db_tables(db):
 """Build Seshet's basic database schema. Requires one parameter, `db` as `pydal.DAL` instance. """

    
    if not isinstance(db, DAL) or not db._uri:
        raise Exception("Need valid DAL object to define tables")

    # event log - self-explanatory, logs all events
    db.define_table('event_log',
                    Field('event_type'),
                    Field('event_time', 'datetime'),
                    Field('source'),
                    Field('target'),
                    Field('message', 'text'),
                    Field('host'),
                    Field('params', 'list:string'),
                    )
    db.define_table('modules',
                    Field('name', notnull=True, unique=True, length=256),
                    Field('enabled', 'boolean'),
                    Field('event_types', 'list:string'),
                    Field('description', 'text'),
                    Field('echannels', 'list:string'),
                    Field('dchannels', 'list:string'),
                    Field('enicks', 'list:string'),
                    Field('dnicks', 'list:string'),
                    Field('whitelist', 'list:string'),
                    Field('blacklist', 'list:string'),
                    Field('cmd_prefix', length=1, default='!', notnull=True),
                    Field('acl', 'json'),
                    Field('rate_limit', 'json'),
                    )