CREATE TABLE tx_nldealers_domain_model_dealer (
	name varchar(255) DEFAULT '' NOT NULL,
	name_extended varchar(255) DEFAULT '' NOT NULL,
	city varchar(255) DEFAULT '' NOT NULL,
	district varchar(255) DEFAULT '' NOT NULL,
	street varchar(255) DEFAULT '' NOT NULL,
	email varchar(255) DEFAULT '' NOT NULL,
	zip varchar(255) DEFAULT '' NOT NULL,
	phone varchar(255) NOT NULL DEFAULT '',
	fax varchar(255) NOT NULL DEFAULT '',
	url varchar(1024) NOT NULL DEFAULT '',
	lat decimal(10,8) default NULL,
	lng decimal(11,8) default NULL,
	import_id  varchar(255) DEFAULT '' NOT NULL,
	abilities int(11) unsigned DEFAULT '0' NOT NULL,
	exhibitions int(11) unsigned DEFAULT '0' NOT NULL,

	KEY import_id (import_id (255)),
);

CREATE TABLE tx_nldealers_domain_model_group (
	name varchar(255) NOT NULL DEFAULT '' ,
	icon int(11) unsigned NOT NULL DEFAULT '0',
	import_id  varchar(255) DEFAULT '' NOT NULL,
	abilities int(11) unsigned NOT NULL DEFAULT '0',

	KEY import_id (import_id),
);

CREATE TABLE tx_nldealers_domain_model_ability (
	name varchar(255) NOT NULL DEFAULT '',
	icon int(11) unsigned NOT NULL DEFAULT '0',
	description text NOT NULL DEFAULT '',
	hidden_in_f_e smallint(1) unsigned NOT NULL DEFAULT '0',
	import_id  varchar(255) DEFAULT '' NOT NULL,
	groups int(11) unsigned DEFAULT '0' NOT NULL,

	KEY import_id (import_id),

);

CREATE TABLE tx_nldealers_dealer_ability_mm (
	uid_local int(11) unsigned DEFAULT '0' NOT NULL,
	uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
	sorting int(11) unsigned DEFAULT '0' NOT NULL,
	sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL,

	PRIMARY KEY (uid_local,uid_foreign),
	KEY uid_local (uid_local),
	KEY uid_foreign (uid_foreign)
);

CREATE TABLE tx_nldealers_dealer_exhibition_mm (
	uid_local int(11) unsigned DEFAULT '0' NOT NULL,
	uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
	sorting int(11) unsigned DEFAULT '0' NOT NULL,
	sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL,

	PRIMARY KEY (uid_local,uid_foreign),
	KEY uid_local (uid_local),
	KEY uid_foreign (uid_foreign)
);

CREATE TABLE tx_nldealers_group_ability_mm (
	uid_local int(11) unsigned DEFAULT '0' NOT NULL,
	uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
	sorting int(11) unsigned DEFAULT '0' NOT NULL,
	sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL,

	PRIMARY KEY (uid_local,uid_foreign),
	KEY uid_local (uid_local),
	KEY uid_foreign (uid_foreign)
);
