CREATE TABLE blogs (
	blog_id int NOT NULL,
	blog_flags int NOT NULL,
	blog_url varchar (255) NULL,
	max_items varchar (4) NULL,
	item_separation_tag varchar (10) NULL,

	CONSTRAINT PK_blogs PRIMARY KEY
	(
		blog_id
	),
	CONSTRAINT FK_blogs_to_resources FOREIGN KEY
	(
		blog_id
	) REFERENCES resources (
		resource_id
	)
)
GO 

INSERT INTO classes (type, super_type, db_name, table_name, java_class)
	VALUES(102, 10, null, 'blogs', 'org.bodington.server.resources.BlogResource');
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(102, 1, 'blog_id', 'setBlogId', 'getBlogId', '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(102, 2, 'blog_flags', 'setBlogFlags', 'getBlogFlags', 'int', 'int', 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(102, 3, 'blog_url', 'setBlogURL', 'getBlogURL', '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(102, 4, 'max_items', 'setMaxNumberOfItems', 'getMaxNumberOfItems', '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(102, 5, 'item_separation_tag', 'setItemSeparationTag', 'getItemSeparationTag', 'java.lang.String', 'java.lang.String', 0, null, null, null );
GO