Edit this page on GitHub

SQL database schema

The docassemble web application requires a central SQL server. The db directive in the configuration tells docassemble where to find this SQL database.

The necessary data tables are created with the docassemble.webapp.create_tables module. If new versions of docassemble add new tables or modify the columns of existing tables, the docassemble.webapp.create_tables module uses alembic to make these changes to the database.

The docassemble.webapp.create_tables module runs automatically within the Docker container whenever the container starts up or when the server restarts (e.g., when a package is installed or upgraded).

The following table lists all of the tables and columns that docassemble uses. (This is output from PostgreSQL, but the same concepts exist in most SQL database systems.)

table_name column_name data_type character_maximum_length column_default
globalobjectstorage id integer   nextval('globalobjectstorage_id_seq'::regclass)
role description character varying 255  
jsonstorage tags text    
userdictkeys filename character varying 255  
package_auth user_id integer    
email all_addr text    
package packageversion text    
user last_name character varying 255 ''::character varying
user_invite email character varying 255  
chatlog temp_user_id integer    
machinelearning dependent text    
email reply_to_addr text    
uploads filename character varying 255  
emailattachment index integer    
globalobjectstorage encrypted boolean   true
userdict filename character varying 255  
email subject text    
install version integer    
speaklist type character varying 20  
email to_addr text    
uploads indexno integer   nextval('uploads_indexno_seq'::regclass)
speaklist dialect character varying 10  
package_auth authtype character varying 255 'owner'::character varying
install id integer   nextval('install_id_seq'::regclass)
emailattachment id integer   nextval('emailattachment_id_seq'::regclass)
chatlog temp_owner_id integer    
user_auth user_id integer    
package upload integer    
install packageversion text    
user active boolean   false
supervisors hostname text    
shortener user_id integer    
globalobjectstorage value text    
role id integer   nextval('role_id_seq'::regclass)
emailattachment content_type text    
attachments encrypted boolean   true
package_auth id integer   nextval('package_auth_id_seq'::regclass)
uploads yamlfile character varying 255  
email id integer   nextval('email_id_seq'::regclass)
uploadsroleauth uploads_indexno integer    
emailattachment upload integer    
user email character varying 255  
package giturl character varying 255  
speaklist key character varying 250  
chatlog key character varying 250  
user password character varying 255 ''::character varying
attachments question integer    
uploads persistent boolean   false
chatlog owner_id integer    
speaklist upload integer    
objectstorage value text    
attachments id integer   nextval('attachments_id_seq'::regclass)
supervisors role text    
email from_addr text    
shortener short character varying 250  
chatlog open_to_peer boolean   false
speaklist language character varying 10  
package id integer   nextval('package_id_seq'::regclass)
user id integer   nextval('user_id_seq'::regclass)
user_roles user_id integer    
jsonstorage filename character varying 255  
attachments dictionary text    
objectstorage id integer   nextval('objectstorage_id_seq'::regclass)
userdictkeys temp_user_id integer    
uploadsuserauth uploads_indexno integer    
user timezone character varying 64  
chatlog message text    
speaklist phrase text    
user nickname character varying 255  
package type text    
email return_path_addr text    
globalobjectstorage temp_user_id integer    
machinelearning group_id character varying 1024  
user first_name character varying 255 ''::character varying
package version integer   1
user_invite token character varying 100 ''::character varying
speaklist id integer   nextval('speaklist_id_seq'::regclass)
package limitation text    
user country character varying 3  
chatlog id integer   nextval('chatlog_id_seq'::regclass)
userdict user_id integer    
user modified_at timestamp without time zone    
speaklist digest text    
machinelearning independent text    
user_roles role_id integer    
uploadsuserauth id integer   nextval('uploadsuserauth_id_seq'::regclass)
jsonstorage id integer   nextval('jsonstorage_id_seq'::regclass)
objectstorage key character varying 1024  
globalobjectstorage user_id integer    
shortener filename character varying 255  
chatlog modtime timestamp without time zone    
chatlog filename character varying 255  
speaklist encrypted boolean   true
uploadsuserauth temp_user_id integer    
shortener key character varying 255  
jsonstorage data jsonb    
uploadsroleauth role_id integer    
chatlog encrypted boolean   true
machinelearning id integer   nextval('machinelearning_id_seq'::regclass)
shortener modtime timestamp without time zone   now()
userdict encrypted boolean   true
speaklist filename character varying 255  
shortener uid character varying 250  
emailattachment extension text    
jsonstorage persistent boolean   false
install package_id integer    
user otp_secret character varying 255  
machinelearning key character varying 1024  
uploads private boolean   true
user subdivisionsecond character varying 255  
package core boolean   false
uploadsroleauth id integer   nextval('uploadsroleauth_id_seq'::regclass)
tempuser id integer   nextval('tempuser_id_seq'::regclass)
alembic_version version_num character varying 32  
machinelearning create_time timestamp without time zone    
package name character varying 255  
user social_id character varying 255  
user_roles id integer   nextval('user_roles_id_seq'::regclass)
email cc_addr text    
jsonstorage key character varying 250  
attachments key character varying 250  
machinelearning active boolean   false
shortener id integer   nextval('shortener_id_seq'::regclass)
user pypi_username character varying 255  
uploadsuserauth user_id integer    
user subdivisionfirst character varying 255  
package dependency boolean   false
package active boolean   true
user subdivisionthird character varying 255  
emailattachment email_id integer    
user_auth id integer   nextval('user_auth_id_seq'::regclass)
supervisors start_time timestamp without time zone   now()
userdict key character varying 250  
install hostname text    
user language character varying 64  
user_invite role_id integer    
email datetime_received timestamp without time zone    
machinelearning modtime timestamp without time zone    
uploads key character varying 250  
package gitsubdir text    
user confirmed_at timestamp without time zone    
user last_login timestamp without time zone    
package_auth package_id integer    
shortener temp_user_id integer    
email short character varying 250  
supervisors id integer   nextval('supervisors_id_seq'::regclass)
package gitbranch character varying 255  
user organization character varying 255  
role name character varying 50  
user_auth reset_password_token character varying 100 ''::character varying
userdictkeys key character varying 250  
attachments filename text    
email datetime_message timestamp without time zone    
userdict modtime timestamp without time zone    
jsonstorage modtime timestamp without time zone   now()
user pypi_password character varying 255  
user_invite invited_by_user_id integer    
userdict dictionary text    
shortener index integer    
supervisors url text    
globalobjectstorage key character varying 1024  
userdictkeys indexno integer   nextval('userdictkeys_indexno_seq'::regclass)
userdict indexno integer   nextval('userdict_indexno_seq'::regclass)
machinelearning info text    
chatlog user_id integer    
userdictkeys user_id integer    
user_auth password character varying 255 ''::character varying
user_invite id integer   nextval('user_invite_id_seq'::regclass)
speaklist question integer