DROP TABLE IF EXISTS character_spell_effects;
CREATE TABLE character_spell_effects (
	name                    TEXT    NOT NULL DEFAULT '',
	caster_char_id          INTEGER NOT NULL DEFAULT 0,
	target_char_id          INTEGER NOT NULL DEFAULT 0,
	target_type             INTEGER NOT NULL DEFAULT 0,
	db_effect_type          INTEGER NOT NULL DEFAULT 0,
	spell_id                INTEGER NOT NULL DEFAULT 0,
	effect_slot             INTEGER NOT NULL DEFAULT 0,
	slot_pos                INTEGER NOT NULL DEFAULT 0,
	icon                    INTEGER NOT NULL DEFAULT 0,
	icon_backdrop           INTEGER NOT NULL DEFAULT 0,
	conc_used               INTEGER NOT NULL DEFAULT 0,
	tier                    INTEGER NOT NULL DEFAULT 0,
	total_time              REAL    NOT NULL DEFAULT 0,
	expire_timestamp        INTEGER NOT NULL DEFAULT 0,
	lua_file                TEXT    NOT NULL DEFAULT '',
	custom_spell            INTEGER NOT NULL DEFAULT 0,
	charid                  INTEGER NOT NULL DEFAULT 0,
	damage_remaining        INTEGER NOT NULL DEFAULT 0,
	effect_bitmask          INTEGER NOT NULL DEFAULT 0,
	num_triggers            INTEGER NOT NULL DEFAULT 0,
	had_triggers            INTEGER NOT NULL DEFAULT 0,
	cancel_after_triggers   INTEGER NOT NULL DEFAULT 0,
	crit                    INTEGER NOT NULL DEFAULT 0,
	last_spellattack_hit    INTEGER NOT NULL DEFAULT 0,
	interrupted             INTEGER NOT NULL DEFAULT 0,
	resisted                INTEGER NOT NULL DEFAULT 0,
	has_damaged             INTEGER NOT NULL DEFAULT 0,
	custom_function         TEXT    NOT NULL,
	caster_level            INTEGER NOT NULL DEFAULT 0
);
