CREATE TABLE external_links (
	external_link_id int NOT NULL ,
	url varchar(255) NOT NULL ,
	link_flags tinyint NOT NULL,
	CONSTRAINT PK_external_links PRIMARY KEY
	(
		external_link_id
	),
	CONSTRAINT FK_external_links_to_resources FOREIGN KEY
	(
		external_link_id
	) REFERENCES resources (
		resource_id
	)
)
GO


INSERT INTO classes (type, super_type, db_name, table_name, java_class)
	VALUES(45, 10, 'building2', 'external_links', 'org.bodington.server.resources.ExternalLink')
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(45, 1, 'external_link_id', 'setExternalLinkId', 'getExternalLinkId', 'org.bodington.database.PrimaryKey', 'org.bodington.database.PrimaryKey', 1, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(45, 2, 'url', 'setUrl', 'getUrl', 'java.lang.String', 'java.lang.String', 0, null, null, null )
GO

INSERT INTO fields (type, sequence, field, set_method_name, get_method_name, set_java_class, get_java_class, flags, foreign_type, set_method_name_foreign, get_method_name_foreign )
	VALUES(45, 3, 'link_flags', 'setLinkFlags', 'getLinkFlags', 'byte', 'byte', 0, null, null, null )
GO
