added db models
added loading rules from db
added save msg logs in db