EliteJournal 1.9.400

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/AUTHORS +1 -0
  2. data/MIT-LICENSE +21 -0
  3. data/README +22 -0
  4. data/app/controllers/account_controller.rb +25 -0
  5. data/app/controllers/application.rb +83 -0
  6. data/app/controllers/atom_controller.rb +26 -0
  7. data/app/controllers/auth_controller.rb +23 -0
  8. data/app/controllers/backend_controller.rb +14 -0
  9. data/app/controllers/css_controller.rb +31 -0
  10. data/app/controllers/draft_controller.rb +62 -0
  11. data/app/controllers/image_controller.rb +11 -0
  12. data/app/controllers/journal_controller.rb +53 -0
  13. data/app/controllers/link_controller.rb +29 -0
  14. data/app/controllers/ping_controller.rb +44 -0
  15. data/app/controllers/post_controller.rb +131 -0
  16. data/app/controllers/rss_controller.rb +22 -0
  17. data/app/controllers/tags_controller.rb +74 -0
  18. data/app/controllers/user_controller.rb +30 -0
  19. data/app/controllers/users_controller.rb +13 -0
  20. data/app/helpers/account_helper.rb +2 -0
  21. data/app/helpers/application_helper.rb +117 -0
  22. data/app/helpers/atom_helper.rb +2 -0
  23. data/app/helpers/auth_helper.rb +2 -0
  24. data/app/helpers/backend_helper.rb +2 -0
  25. data/app/helpers/css_helper.rb +2 -0
  26. data/app/helpers/draft_helper.rb +2 -0
  27. data/app/helpers/image_helper.rb +2 -0
  28. data/app/helpers/journal_helper.rb +2 -0
  29. data/app/helpers/link_helper.rb +2 -0
  30. data/app/helpers/ping_helper.rb +5 -0
  31. data/app/helpers/post_helper.rb +2 -0
  32. data/app/helpers/rss_helper.rb +5 -0
  33. data/app/helpers/tags_helper.rb +7 -0
  34. data/app/helpers/user_helper.rb +2 -0
  35. data/app/helpers/users_helper.rb +2 -0
  36. data/app/models/blogger_api.rb +24 -0
  37. data/app/models/comment.rb +18 -0
  38. data/app/models/draft.rb +12 -0
  39. data/app/models/face.rb +24 -0
  40. data/app/models/feed_killer.rb +17 -0
  41. data/app/models/image.rb +7 -0
  42. data/app/models/link.rb +10 -0
  43. data/app/models/meta_weblog_api.rb +82 -0
  44. data/app/models/ping.rb +16 -0
  45. data/app/models/post.rb +30 -0
  46. data/app/models/stylesheet.rb +7 -0
  47. data/app/models/tag.rb +16 -0
  48. data/app/models/user.rb +35 -0
  49. data/app/views/account/info.rhtml +30 -0
  50. data/app/views/atom/feed.rxml +15 -0
  51. data/app/views/auth/login.rhtml +9 -0
  52. data/app/views/css/edit.rhtml +18 -0
  53. data/app/views/css/list.rhtml +24 -0
  54. data/app/views/css/new.rhtml +6 -0
  55. data/app/views/draft/edit.rhtml +9 -0
  56. data/app/views/draft/list.rhtml +22 -0
  57. data/app/views/draft/new.rhtml +9 -0
  58. data/app/views/journal/_comment.rhtml +10 -0
  59. data/app/views/journal/_post.rhtml +40 -0
  60. data/app/views/journal/_trackback.rhtml +4 -0
  61. data/app/views/journal/error.rhtml +1 -0
  62. data/app/views/journal/index.rhtml +1 -0
  63. data/app/views/journal/view.rhtml +15 -0
  64. data/app/views/layouts/application.rhtml +90 -0
  65. data/app/views/link/list.rhtml +19 -0
  66. data/app/views/link/new.rhtml +7 -0
  67. data/app/views/ping/trackback.rxml +4 -0
  68. data/app/views/post/_reply.rhtml +10 -0
  69. data/app/views/post/destroyxml.rxml +3 -0
  70. data/app/views/post/edit.rhtml +7 -0
  71. data/app/views/post/new.rhtml +13 -0
  72. data/app/views/post/postxml.rxml +7 -0
  73. data/app/views/post/reply.rhtml +33 -0
  74. data/app/views/post/replyxml.rxml +5 -0
  75. data/app/views/post/toggle_commentingxml.rxml +9 -0
  76. data/app/views/rss/index.rxml +15 -0
  77. data/app/views/tags/addxml.rxml +4 -0
  78. data/app/views/tags/index.rhtml +3 -0
  79. data/app/views/tags/no_completions.rhtml +1 -0
  80. data/app/views/tags/search.rhtml +10 -0
  81. data/app/views/tags/search_completer.rhtml +1 -0
  82. data/app/views/user/list.rhtml +21 -0
  83. data/app/views/user/new.rhtml +12 -0
  84. data/app/views/users/index.rhtml +6 -0
  85. data/config/app.yml +15 -0
  86. data/config/database.yml +17 -0
  87. data/config/environment.rb +58 -0
  88. data/config/environments/development.rb +5 -0
  89. data/config/environments/geminstall.rb +4 -0
  90. data/config/environments/production.rb +3 -0
  91. data/config/environments/shared.rb +17 -0
  92. data/config/environments/test.rb +3 -0
  93. data/db/db-mysql.sql +95 -0
  94. data/db/db-postgresql.sql +94 -0
  95. data/db/db-sqlite.sql +94 -0
  96. data/db/default_user.sql +1 -0
  97. data/db/development_structure.sql +257 -0
  98. data/elitejournal +132 -0
  99. data/lib/image_size.rb +277 -0
  100. data/lib/trackback.rb +45 -0
  101. data/public/404.html +6 -0
  102. data/public/500.html +6 -0
  103. data/public/dispatch.cgi +10 -0
  104. data/public/dispatch.fcgi +7 -0
  105. data/public/dispatch.rb +10 -0
  106. data/public/stylesheets/ej-layout.css +126 -0
  107. data/public/stylesheets/ej-style.css +105 -0
  108. data/public/stylesheets/undohtml.css +9 -0
  109. metadata +178 -0
@@ -0,0 +1,6 @@
1
+ <dl>
2
+ <% @users.each do |u| -%>
3
+ <dt><%= link_to u.username, :controller => 'users', :action => u.username %></dt>
4
+ <dd><%= u.name %>, <%= u.posts.count %> posts. <% if u.posts.first %>Last posted on <%= link_to u.posts.first.created_at.strftime('%D'), :controller => 'journal', :action => 'view', :id => u.posts.first.id %>.<% end %></dd>
5
+ <% end -%>
6
+ </dl>
data/config/app.yml ADDED
@@ -0,0 +1,15 @@
1
+ main:
2
+ title: My Elite Journal
3
+ subtitle: Happy Birthday To Me
4
+ num_posts: 5
5
+ num_news: 5
6
+ app_base: /
7
+
8
+ uploads:
9
+ max_face_size: 153600
10
+
11
+ tags:
12
+ Flickr: http://www.flickr.com/photos/tags/%s/
13
+ 43things: http://43things.com/tags/view?name=%s
14
+ Technorati: http://www.technorati.com/tags/%s
15
+ del.icio.us: http://del.icio.us/tag/%s
@@ -0,0 +1,17 @@
1
+ development:
2
+ adapter: postgresql
3
+ database: eliteblog
4
+ username: scott
5
+ password:
6
+
7
+ production:
8
+ adapter: postgresql
9
+ database: eliteblog
10
+ username: scott
11
+ password:
12
+
13
+ test:
14
+ adapter: postgresql
15
+ database: eliteblog_test
16
+ username: scott
17
+ password:
@@ -0,0 +1,58 @@
1
+ RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + "/../")
2
+ RAILS_ENV = ENV['RAILS_ENV'] || 'development'
3
+
4
+
5
+ # Mocks first.
6
+ ADDITIONAL_LOAD_PATHS = ["#{RAILS_ROOT}/test/mocks/#{RAILS_ENV}"]
7
+
8
+ # Then model subdirectories.
9
+ ADDITIONAL_LOAD_PATHS.concat(Dir["#{RAILS_ROOT}/app/models/[_a-z]*"])
10
+
11
+ # Followed by the standard includes.
12
+ ADDITIONAL_LOAD_PATHS.concat %w(
13
+ app
14
+ app/models
15
+ app/controllers
16
+ app/helpers
17
+ config
18
+ lib
19
+ vendor
20
+ ).map { |dir| "#{RAILS_ROOT}/#{dir}" }
21
+
22
+ # Prepend to $LOAD_PATH
23
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
24
+
25
+
26
+ # Require Rails gems.
27
+ require 'rubygems'
28
+ require_gem 'activerecord'
29
+ require_gem 'actionpack'
30
+ require_gem 'actionmailer'
31
+ require_gem 'rails'
32
+
33
+
34
+ # Environment-specific configuration.
35
+ require_dependency "environments/#{RAILS_ENV}"
36
+ if RAILS_ENV == 'geminstall'
37
+ ActiveRecord::Base.configurations = YAML::load(File.open("#{ENV['HOME']}/.elitejournal/database.yml"))
38
+ RAILS_DEFAULT_LOGGER = Logger.new("#{ENV['HOME']}/.elitejournal/elitejournal.log")
39
+ RAILS_DEFAULT_LOGGER.level == Logger::WARN
40
+ else
41
+ ActiveRecord::Base.configurations = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
42
+ end
43
+
44
+ ActiveRecord::Base.establish_connection
45
+
46
+
47
+ # Configure defaults if the included environment did not.
48
+ RAILS_DEFAULT_LOGGER = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}.log") unless RAILS_ENV == 'geminstall'
49
+ [ActiveRecord::Base, ActionController::Base, ActionMailer::Base].each do |klass|
50
+ klass.logger ||= RAILS_DEFAULT_LOGGER
51
+ end
52
+ [ActionController::Base, ActionMailer::Base].each do |klass|
53
+ klass.template_root ||= "#{RAILS_ROOT}/app/views/"
54
+ end
55
+
56
+
57
+ # Include your app's configuration here:
58
+ #ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:database_manager => CGI::Session::ActiveRecordStore)
@@ -0,0 +1,5 @@
1
+ ActionController::Base.consider_all_requests_local = true
2
+ Dependencies.mechanism = :load
3
+
4
+ BREAKPOINT_SERVER_PORT = 42531
5
+ ActionController::Base.perform_caching = false
@@ -0,0 +1,4 @@
1
+ ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:database_manager => CGI::Session::MemoryStore)
2
+
3
+ ActionController::Base.consider_all_requests_local = false
4
+ Dependencies.mechanism = :require
@@ -0,0 +1,3 @@
1
+ ActionController::Base.consider_all_requests_local = false
2
+ Dependencies.mechanism = :require
3
+ ActionController::Base.perform_caching = true
@@ -0,0 +1,17 @@
1
+ ADDITIONAL_LOAD_PATHS = [ "app/models", "app/controllers", "app/helpers", "config", "lib", "vendor" ]
2
+ ADDITIONAL_LOAD_PATHS.each { |dir| $:.unshift "#{File.dirname(__FILE__)}/../../#{dir}" }
3
+
4
+ require 'rubygems'
5
+
6
+ require_gem 'activerecord'
7
+ require_gem 'actionpack'
8
+ require_gem 'actionmailer'
9
+ require_gem 'rails'
10
+
11
+ require 'yaml'
12
+
13
+ ActionController::Base.template_root = ActionMailer::Base.template_root = File.dirname(__FILE__) + '/../../app/views/'
14
+
15
+ def database_configurations
16
+ YAML::load(File.open(File.dirname(__FILE__) + "/../../config/database.yml"))
17
+ end
@@ -0,0 +1,3 @@
1
+ ActionController::Base.consider_all_requests_local = true
2
+ Dependencies.mechanism = :require
3
+ ActionController::Base.perform_caching = false
data/db/db-mysql.sql ADDED
@@ -0,0 +1,95 @@
1
+ CREATE TABLE posts (
2
+ id INT AUTO_INCREMENT,
3
+ user_id INT NOT NULL,
4
+ created_at DATETIME,
5
+ updated_at DATETIME,
6
+ subject VARCHAR(255) NOT NULL,
7
+ body TEXT NOT NULL,
8
+ rendered TEXT NOT NULL DEFAULT '',
9
+ allows_comment TINYINT NOT NULL DEFAULT 1,
10
+ PRIMARY KEY (id)
11
+ );
12
+
13
+ CREATE TABLE tags (
14
+ id INT AUTO_INCREMENT,
15
+ tag VARCHAR(255) NOT NULL,
16
+ numitems INT NOT NULL DEFAULT 0,
17
+ PRIMARY KEY (id)
18
+ );
19
+
20
+ CREATE TABLE posts_tags (
21
+ tag_id INT NOT NULL,
22
+ post_id INT NOT NULL
23
+ );
24
+
25
+ CREATE TABLE drafts (
26
+ id INT AUTO_INCREMENT,
27
+ user_id INT NOT NULL,
28
+ created_at DATETIME,
29
+ subject VARCHAR(255) ,
30
+ tb_url VARCHAR(255) DEFAULT '',
31
+ body TEXT ,
32
+ PRIMARY KEY (id)
33
+ );
34
+
35
+ CREATE TABLE comments (
36
+ id INT AUTO_INCREMENT,
37
+ post_id INT NOT NULL DEFAULT 0,
38
+ comment_id INT NOT NULL DEFAULT 0,
39
+ posted_by VARCHAR(255) NOT NULL DEFAULT '',
40
+ created_at TIMESTAMP,
41
+ subject VARCHAR(255) NOT NULL DEFAULT '',
42
+ body TEXT NOT NULL,
43
+ rendered TEXT NOT NULL DEFAULT '',
44
+ PRIMARY KEY (id)
45
+ );
46
+
47
+ CREATE TABLE users (
48
+ id INT AUTO_INCREMENT,
49
+ username VARCHAR(255) NOT NULL,
50
+ password VARCHAR(255) NOT NULL,
51
+ name VARCHAR(255) NOT NULL,
52
+ is_admin TINYINT NOT NULL DEFAULT 0,
53
+ allows_comment TINYINT NOT NULL DEFAULT 1,
54
+ title VARCHAR(255) DEFAULT '',
55
+ subtitle VARCHAR(255) DEFAULT '',
56
+ PRIMARY KEY (id)
57
+ );
58
+
59
+ CREATE TABLE images (
60
+ id INT AUTO_INCREMENT,
61
+ type VARCHAR(25) NOT NULL,
62
+ user_id INT NOT NULL,
63
+ picture BLOB NOT NULL,
64
+ content_type VARCHAR(255) NOT NULL,
65
+ height VARCHAR(4) NOT NULL,
66
+ width VARCHAR(4) NOT NULL,
67
+ updated_at TIMESTAMP,
68
+ PRIMARY KEY (id)
69
+ );
70
+
71
+ CREATE TABLE pings (
72
+ id INT AUTO_INCREMENT,
73
+ post_id INT NOT NULL DEFAULT 0,
74
+ title VARCHAR(255) DEFAULT '',
75
+ excerpt VARCHAR(255) DEFAULT '',
76
+ url VARCHAR(255) DEFAULT '',
77
+ blog_name VARCHAR(255) DEFAULT '',
78
+ PRIMARY KEY (id)
79
+ );
80
+
81
+ CREATE TABLE links (
82
+ id INT AUTO_INCREMENT,
83
+ user_id INT NOT NULL,
84
+ link_text VARCHAR(255) NOT NULL,
85
+ link_url VARCHAR(255) NOT NULL,
86
+ PRIMARY KEY (id)
87
+ );
88
+
89
+ CREATE TABLE stylesheets (
90
+ id INT AUTO_INCREMENT,
91
+ user_id INT NOT NULL,
92
+ data TEXT NOT NULL DEFAULT '',
93
+ PRIMARY KEY (id)
94
+ );
95
+
@@ -0,0 +1,94 @@
1
+ CREATE TABLE posts (
2
+ id SERIAL,
3
+ user_id INT NOT NULL,
4
+ created_at TIMESTAMP,
5
+ updated_at TIMESTAMP,
6
+ subject VARCHAR(255) NOT NULL,
7
+ body TEXT NOT NULL,
8
+ rendered TEXT NOT NULL DEFAULT '',
9
+ allows_comment BOOLEAN NOT NULL DEFAULT 't',
10
+ PRIMARY KEY (id)
11
+ );
12
+
13
+ CREATE TABLE tags (
14
+ id SERIAL,
15
+ tag VARCHAR(255) NOT NULL,
16
+ numitems INT NOT NULL DEFAULT 0,
17
+ PRIMARY KEY (id)
18
+ );
19
+
20
+ CREATE TABLE posts_tags (
21
+ tag_id INT NOT NULL,
22
+ post_id INT NOT NULL
23
+ );
24
+
25
+ CREATE TABLE drafts (
26
+ id SERIAL,
27
+ user_id INT NOT NULL,
28
+ created_at TIMESTAMP,
29
+ subject VARCHAR(255) ,
30
+ tb_url VARCHAR(255) DEFAULT '',
31
+ body TEXT ,
32
+ PRIMARY KEY (id)
33
+ );
34
+
35
+ CREATE TABLE comments (
36
+ id SERIAL,
37
+ post_id INT NOT NULL DEFAULT 0,
38
+ comment_id INT NOT NULL DEFAULT 0,
39
+ posted_by VARCHAR(255) NOT NULL DEFAULT '',
40
+ created_at TIMESTAMP,
41
+ subject VARCHAR(255) NOT NULL DEFAULT '',
42
+ body TEXT NOT NULL,
43
+ rendered TEXT NOT NULL DEFAULT '',
44
+ PRIMARY KEY (id)
45
+ );
46
+
47
+ CREATE TABLE users (
48
+ id SERIAL,
49
+ username VARCHAR(255) NOT NULL,
50
+ password VARCHAR(255) NOT NULL,
51
+ name VARCHAR(255) NOT NULL,
52
+ is_admin BOOLEAN NOT NULL DEFAULT 'f',
53
+ allows_comment BOOLEAN NOT NULL DEFAULT 't',
54
+ title VARCHAR(255) DEFAULT '',
55
+ subtitle VARCHAR(255) DEFAULT '',
56
+ PRIMARY KEY (id)
57
+ );
58
+
59
+ CREATE TABLE images (
60
+ id SERIAL,
61
+ type VARCHAR(25) NOT NULL,
62
+ user_id INT NOT NULL,
63
+ picture BYTEA NOT NULL,
64
+ content_type VARCHAR(255) NOT NULL,
65
+ height VARCHAR(4) NOT NULL,
66
+ width VARCHAR(4) NOT NULL,
67
+ updated_at TIMESTAMP,
68
+ PRIMARY KEY (id)
69
+ );
70
+
71
+ CREATE TABLE pings (
72
+ id SERIAL,
73
+ post_id INT NOT NULL DEFAULT 0,
74
+ title VARCHAR(255) DEFAULT '',
75
+ excerpt VARCHAR(255) DEFAULT '',
76
+ url VARCHAR(255) DEFAULT '',
77
+ blog_name VARCHAR(255) DEFAULT '',
78
+ PRIMARY KEY (id)
79
+ );
80
+
81
+ CREATE TABLE links (
82
+ id SERIAL,
83
+ user_id INT NOT NULL,
84
+ link_text VARCHAR(255) NOT NULL,
85
+ link_url VARCHAR(255) NOT NULL,
86
+ PRIMARY KEY (id)
87
+ );
88
+
89
+ CREATE TABLE stylesheets (
90
+ id SERIAL,
91
+ user_id INT NOT NULL,
92
+ data TEXT NOT NULL DEFAULT '',
93
+ PRIMARY KEY (id)
94
+ );
data/db/db-sqlite.sql ADDED
@@ -0,0 +1,94 @@
1
+ CREATE TABLE posts (
2
+ id INTEGER,
3
+ user_id INT NOT NULL,
4
+ created_at DATETIME,
5
+ updated_at DATETIME,
6
+ subject VARCHAR(255) NOT NULL,
7
+ body TEXT NOT NULL,
8
+ rendered TEXT NOT NULL DEFAULT '',
9
+ allows_comment TINYINT NOT NULL DEFAULT '1',
10
+ PRIMARY KEY (id)
11
+ );
12
+
13
+ CREATE TABLE tags (
14
+ id INTEGER,
15
+ tag VARCHAR(255) NOT NULL,
16
+ numitems INT NOT NULL DEFAULT 0,
17
+ PRIMARY KEY (id)
18
+ );
19
+
20
+ CREATE TABLE posts_tags (
21
+ tag_id INT NOT NULL,
22
+ post_id INT NOT NULL
23
+ );
24
+
25
+ CREATE TABLE drafts (
26
+ id INTEGER,
27
+ user_id INT NOT NULL,
28
+ created_at DATETIME,
29
+ subject VARCHAR(255) ,
30
+ tb_url VARCHAR(255) DEFAULT '',
31
+ body TEXT ,
32
+ PRIMARY KEY (id)
33
+ );
34
+
35
+ CREATE TABLE comments (
36
+ id INTEGER,
37
+ post_id INT NOT NULL DEFAULT 0,
38
+ comment_id INT NOT NULL DEFAULT 0,
39
+ posted_by VARCHAR(255) NOT NULL DEFAULT '',
40
+ created_at TIMESTAMP,
41
+ subject VARCHAR(255) NOT NULL DEFAULT '',
42
+ body TEXT NOT NULL,
43
+ rendered TEXT NOT NULL DEFAULT '',
44
+ PRIMARY KEY (id)
45
+ );
46
+
47
+ CREATE TABLE users (
48
+ id INTEGER,
49
+ username VARCHAR(255) NOT NULL,
50
+ password VARCHAR(255) NOT NULL,
51
+ name VARCHAR(255) NOT NULL,
52
+ is_admin TINYINT NOT NULL DEFAULT '0',
53
+ allows_comment TINYINT NOT NULL DEFAULT '1',
54
+ title VARCHAR(255) DEFAULT '',
55
+ subtitle VARCHAR(255) DEFAULT '',
56
+ PRIMARY KEY (id)
57
+ );
58
+
59
+ CREATE TABLE images (
60
+ id INTEGER,
61
+ type VARCHAR(100) NOT NULL,
62
+ user_id INT NOT NULL DEFAULT 0,
63
+ picture BLOB NOT NULL DEFAULT '',
64
+ content_type VARCHAR(255) NOT NULL,
65
+ height VARCHAR(4) NOT NULL,
66
+ width VARCHAR(4) NOT NULL,
67
+ updated_at TIMESTAMP,
68
+ PRIMARY KEY (id)
69
+ );
70
+
71
+ CREATE TABLE pings (
72
+ id INTEGER,
73
+ post_id INT NOT NULL DEFAULT 0,
74
+ title VARCHAR(255) DEFAULT '',
75
+ excerpt VARCHAR(255) DEFAULT '',
76
+ url VARCHAR(255) DEFAULT '',
77
+ blog_name VARCHAR(255) DEFAULT '',
78
+ PRIMARY KEY (id)
79
+ );
80
+
81
+ CREATE TABLE links (
82
+ id INTEGER,
83
+ user_id INT NOT NULL,
84
+ link_text VARCHAR(255) NOT NULL,
85
+ link_url VARCHAR(255) NOT NULL,
86
+ PRIMARY KEY (id)
87
+ );
88
+
89
+ CREATE TABLE stylesheets (
90
+ id INTEGER,
91
+ user_id INT NOT NULL,
92
+ data TEXT NOT NULL DEFAULT '',
93
+ PRIMARY KEY (id)
94
+ );
@@ -0,0 +1 @@
1
+ INSERT INTO users(username, password, name, is_admin, title, subtitle) VALUES('admin', 'f9a678a936a136e855fa9ef5093fe299', 'Administrator', '1', 'My Elite Journal', 'Happy Birthday To Me');
@@ -0,0 +1,257 @@
1
+ --
2
+ -- PostgreSQL database dump
3
+ --
4
+
5
+ SET client_encoding = 'SQL_ASCII';
6
+ SET check_function_bodies = false;
7
+
8
+ SET SESSION AUTHORIZATION 'scott';
9
+
10
+ --
11
+ -- TOC entry 4 (OID 2200)
12
+ -- Name: public; Type: ACL; Schema: -; Owner: scott
13
+ --
14
+
15
+ REVOKE ALL ON SCHEMA public FROM PUBLIC;
16
+ GRANT ALL ON SCHEMA public TO PUBLIC;
17
+
18
+
19
+ SET SESSION AUTHORIZATION 'scott';
20
+
21
+ SET search_path = public, pg_catalog;
22
+
23
+ --
24
+ -- TOC entry 5 (OID 520573)
25
+ -- Name: posts; Type: TABLE; Schema: public; Owner: scott
26
+ --
27
+
28
+ CREATE TABLE posts (
29
+ id serial NOT NULL,
30
+ user_id integer NOT NULL,
31
+ created_at timestamp without time zone,
32
+ updated_at timestamp without time zone,
33
+ subject character varying(255) NOT NULL,
34
+ body text NOT NULL,
35
+ rendered text DEFAULT ''::text NOT NULL,
36
+ allows_comment boolean DEFAULT true NOT NULL
37
+ );
38
+
39
+
40
+ --
41
+ -- TOC entry 6 (OID 520585)
42
+ -- Name: tags; Type: TABLE; Schema: public; Owner: scott
43
+ --
44
+
45
+ CREATE TABLE tags (
46
+ id serial NOT NULL,
47
+ tag character varying(255) NOT NULL,
48
+ numitems integer DEFAULT 0 NOT NULL
49
+ );
50
+
51
+
52
+ --
53
+ -- TOC entry 7 (OID 520591)
54
+ -- Name: posts_tags; Type: TABLE; Schema: public; Owner: scott
55
+ --
56
+
57
+ CREATE TABLE posts_tags (
58
+ tag_id integer NOT NULL,
59
+ post_id integer NOT NULL
60
+ );
61
+
62
+
63
+ --
64
+ -- TOC entry 8 (OID 520595)
65
+ -- Name: drafts; Type: TABLE; Schema: public; Owner: scott
66
+ --
67
+
68
+ CREATE TABLE drafts (
69
+ id serial NOT NULL,
70
+ user_id integer NOT NULL,
71
+ created_at timestamp without time zone,
72
+ subject character varying(255),
73
+ tb_url character varying(255) DEFAULT ''::character varying,
74
+ body text
75
+ );
76
+
77
+
78
+ --
79
+ -- TOC entry 9 (OID 520606)
80
+ -- Name: comments; Type: TABLE; Schema: public; Owner: scott
81
+ --
82
+
83
+ CREATE TABLE comments (
84
+ id serial NOT NULL,
85
+ post_id integer DEFAULT 0 NOT NULL,
86
+ comment_id integer DEFAULT 0 NOT NULL,
87
+ posted_by character varying(255) DEFAULT ''::character varying NOT NULL,
88
+ created_at timestamp without time zone,
89
+ subject character varying(255) DEFAULT ''::character varying NOT NULL,
90
+ body text NOT NULL,
91
+ rendered text DEFAULT ''::text NOT NULL
92
+ );
93
+
94
+
95
+ --
96
+ -- TOC entry 10 (OID 520642)
97
+ -- Name: pings; Type: TABLE; Schema: public; Owner: scott
98
+ --
99
+
100
+ CREATE TABLE pings (
101
+ id serial NOT NULL,
102
+ post_id integer DEFAULT 0 NOT NULL,
103
+ title character varying(255) DEFAULT ''::character varying,
104
+ excerpt character varying(255) DEFAULT ''::character varying,
105
+ url character varying(255) DEFAULT ''::character varying,
106
+ blog_name character varying(255) DEFAULT ''::character varying
107
+ );
108
+
109
+
110
+ --
111
+ -- TOC entry 11 (OID 520654)
112
+ -- Name: links; Type: TABLE; Schema: public; Owner: scott
113
+ --
114
+
115
+ CREATE TABLE links (
116
+ id serial NOT NULL,
117
+ user_id integer NOT NULL,
118
+ link_text character varying(255) NOT NULL,
119
+ link_url character varying(255) NOT NULL
120
+ );
121
+
122
+
123
+ --
124
+ -- TOC entry 12 (OID 520661)
125
+ -- Name: stylesheets; Type: TABLE; Schema: public; Owner: scott
126
+ --
127
+
128
+ CREATE TABLE stylesheets (
129
+ id serial NOT NULL,
130
+ user_id integer NOT NULL,
131
+ data text DEFAULT ''::text NOT NULL
132
+ );
133
+
134
+
135
+ --
136
+ -- TOC entry 13 (OID 520674)
137
+ -- Name: images; Type: TABLE; Schema: public; Owner: scott
138
+ --
139
+
140
+ CREATE TABLE images (
141
+ id serial NOT NULL,
142
+ "type" character varying(25) NOT NULL,
143
+ user_id integer NOT NULL,
144
+ picture bytea NOT NULL,
145
+ content_type character varying(255) NOT NULL,
146
+ height character varying(4) NOT NULL,
147
+ width character varying(4) NOT NULL,
148
+ updated_at timestamp without time zone
149
+ );
150
+
151
+
152
+ --
153
+ -- TOC entry 14 (OID 584889)
154
+ -- Name: users; Type: TABLE; Schema: public; Owner: scott
155
+ --
156
+
157
+ CREATE TABLE users (
158
+ id serial NOT NULL,
159
+ username character varying(255) NOT NULL,
160
+ "password" character varying(255) NOT NULL,
161
+ name character varying(255) NOT NULL,
162
+ is_admin boolean DEFAULT false NOT NULL,
163
+ allows_comment boolean DEFAULT true NOT NULL,
164
+ title character varying(255) DEFAULT ''::character varying,
165
+ subtitle character varying(255) DEFAULT ''::character varying
166
+ );
167
+
168
+
169
+ --
170
+ -- TOC entry 15 (OID 520581)
171
+ -- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
172
+ --
173
+
174
+ ALTER TABLE ONLY posts
175
+ ADD CONSTRAINT posts_pkey PRIMARY KEY (id);
176
+
177
+
178
+ --
179
+ -- TOC entry 16 (OID 520589)
180
+ -- Name: tags_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
181
+ --
182
+
183
+ ALTER TABLE ONLY tags
184
+ ADD CONSTRAINT tags_pkey PRIMARY KEY (id);
185
+
186
+
187
+ --
188
+ -- TOC entry 17 (OID 520602)
189
+ -- Name: drafts_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
190
+ --
191
+
192
+ ALTER TABLE ONLY drafts
193
+ ADD CONSTRAINT drafts_pkey PRIMARY KEY (id);
194
+
195
+
196
+ --
197
+ -- TOC entry 18 (OID 520617)
198
+ -- Name: comments_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
199
+ --
200
+
201
+ ALTER TABLE ONLY comments
202
+ ADD CONSTRAINT comments_pkey PRIMARY KEY (id);
203
+
204
+
205
+ --
206
+ -- TOC entry 19 (OID 520650)
207
+ -- Name: pings_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
208
+ --
209
+
210
+ ALTER TABLE ONLY pings
211
+ ADD CONSTRAINT pings_pkey PRIMARY KEY (id);
212
+
213
+
214
+ --
215
+ -- TOC entry 20 (OID 520657)
216
+ -- Name: links_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
217
+ --
218
+
219
+ ALTER TABLE ONLY links
220
+ ADD CONSTRAINT links_pkey PRIMARY KEY (id);
221
+
222
+
223
+ --
224
+ -- TOC entry 21 (OID 520668)
225
+ -- Name: stylesheets_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
226
+ --
227
+
228
+ ALTER TABLE ONLY stylesheets
229
+ ADD CONSTRAINT stylesheets_pkey PRIMARY KEY (id);
230
+
231
+
232
+ --
233
+ -- TOC entry 22 (OID 520680)
234
+ -- Name: images_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
235
+ --
236
+
237
+ ALTER TABLE ONLY images
238
+ ADD CONSTRAINT images_pkey PRIMARY KEY (id);
239
+
240
+
241
+ --
242
+ -- TOC entry 23 (OID 584896)
243
+ -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: scott
244
+ --
245
+
246
+ ALTER TABLE ONLY users
247
+ ADD CONSTRAINT users_pkey PRIMARY KEY (id);
248
+
249
+
250
+ --
251
+ -- TOC entry 3 (OID 2200)
252
+ -- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: scott
253
+ --
254
+
255
+ COMMENT ON SCHEMA public IS 'Standard public schema';
256
+
257
+