CREATE TABLE messaging_events (
	messaging_event_id int NOT NULL ,
	message_id int ,
	thread_id int ,
	CONSTRAINT PK_messaging_events PRIMARY KEY
	(
		messaging_event_id
	),
	CONSTRAINT FK_messaging_events_to_events FOREIGN KEY
	(
		messaging_event_id
	) REFERENCES events (
		event_id
	)
)
GO


INSERT INTO classes (type, super_type, db_name, table_name, java_class)
	VALUES(19,	14, 'building2', 'messaging_events', 'org.bodington.server.events.MessagingEvent')
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(19, 1, 'messaging_event_id', 'setMessagingEventId', 'getMessagingEventId', '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(19, 2, 'message_id', 'setMessageId', 'getMessageId', 'java.lang.Integer', 'java.lang.Integer', 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(19, 3, 'thread_id', 'setThreadId', 'getThreadId', 'java.lang.Integer', 'java.lang.Integer', 0, null, null, null )
GO

