Skip to content
Browse files

Add resetdb script, small updates/tweaks

  • Loading branch information...
1 parent 22e508a commit 831cb59e26c63627c4b5a141e23a5c483d53acf7 @mitechie committed Jun 29, 2012
View
7 bookie/static/css/readable.scss
@@ -20,8 +20,11 @@
}
a {
- color: lighten($links, 20%);
+ color: darken($links, 20%);
text-decoration: none;
}
-}
+ img {
+ max-width: 100%;
+ }
+}
View
5 bookie/static/js/bookie/model.js
@@ -252,8 +252,9 @@ YUI.add('bookie-model', function (Y) {
'domain': {
getter: function () {
var url = this.get('url');
- var domain = url.replace('http://','').replace('https://','').split(/[/?#]/)[0];
- return domain;
+ var domain = url.replace('http://','').replace('https://','').split(/[/?#]/)[0]
+ var spl = domain.split('.')
+ return [spl[spl.length-2], spl[spl.length-1]].join('.')
}
},
View
9 bookie/static/js/tests/test_model.js
@@ -45,8 +45,6 @@ YUI.add('bookie-test-model', function (Y) {
});
},
-
-
"Bmark model should exist": function () {
A.isObject(
Y.bookie.Bmark,
@@ -88,6 +86,13 @@ YUI.add('bookie-test-model', function (Y) {
"Stored should be converted from string to Date object");
},
+ "model domain should parse out the url properly": function () {
+ var b = new Y.bookie.Bmark({
+ url: 'http://dotfiles.github.com/test#something'
+ });
+ Y.Assert.areEqual('github.com', b.get('domain'));
+ },
+
"calling remove should run destroy": function () {
var bmark = test_model();
View
1 dbversions/versions/5920b225d05d_load_up_to_date.py
@@ -122,6 +122,7 @@ def upgrade():
sa.Column('content_type', sa.Unicode(length=255), nullable=True),
sa.Column('status_code', sa.Integer(), nullable=True),
sa.Column('status_message', sa.Unicode(length=255), nullable=True),
+ sa.ForeignKeyConstraint(['bid'], ['bmarks.bid'], ),
sa.PrimaryKeyConstraint('bid')
)
### end Alembic commands ###
View
3 scripts/admin/deduper.py
@@ -10,8 +10,9 @@
from collections import defaultdict
from ConfigParser import ConfigParser
from os import path
-
from bookie.models import initialize_sql
+
+
if __name__ == "__main__":
ini = ConfigParser()
ini_path = path.join(path.dirname(path.dirname(path.dirname(__file__))),
View
24 scripts/admin/resetdb.sh
@@ -0,0 +1,24 @@
+#!/bin/zsh
+
+
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_activations" --table "public.activations" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_readable" --table "public.bmark_readable" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_bmark_tags" --table "public.bmark_tags" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_bmarks" --table "public.bmarks" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_import" --table "public.import_queue" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_logging" --table "public.logging" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_stats_bookmarks" --table "public.stats_bookmarks" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_tags" --table "public.tags" "dbname"
+# pg_dump --host 127.0.0.1 --port 5432 --format plain --data-only --inserts --column-inserts --verbose --file "bookie_url_hash" --table "public.url_hash" "dbname"
+
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_rm_default_user
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_users
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_activations
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_tags
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_logging
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_stats_bookmarks
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_url_hash
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_bmarks
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_bmark_tags
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_readable
+psql --host 127.0.0.1 --port 5432 "dbname" -f bookie_import

0 comments on commit 831cb59

Please sign in to comment.
Something went wrong with that request. Please try again.