Skip to content

Set up the groundwork for a port to Diesel #589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .buildpacks
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
https://github.com/rcaught/heroku-buildpack-cmake#e4e2c9e
https://github.com/emk/heroku-buildpack-rust#035823
https://github.com/mmirate/heroku-buildpack-rust#f1cf6643e
https://github.com/tonycoco/heroku-buildpack-ember-cli
https://github.com/ryandotsmith/nginx-buildpack.git#af813ba
https://github.com/sgrif/heroku-buildpack-diesel#43267f2
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ install:
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
- yarn
- yarn run bower install
- cargo install diesel_cli --debug --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH

before_script:
- psql -c 'create database cargo_registry_test;' -U postgres
- diesel database setup

script:
- cargo build
Expand All @@ -42,6 +43,7 @@ addons:

env:
global:
- DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
- TEST_DATABASE_URL=postgres://postgres:@localhost/cargo_registry_test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh so if travis is using DATABASE_URL now, do we need to set TEST_DATABASE_URL anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DATABASE_URL is just used by diesel for migrations by convention. The tests still run using TEST_DATABASE_URL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also using DATABASE_URL for compilation before, but since we don't need that now I can just specify --database-url instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean just for diesel database setup, not migrations, right? because it looks like src/tests/all.rs takes care of the migrations and uses TEST_DATABASE_URL? I just want to make sure I understand :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. diesel database setup runs migrations as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i see

- S3_BUCKET=alexcrichton-test

Expand Down
138 changes: 138 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ rustc-serialize = "0.3"
license-exprs = "^1.3"
dotenv = "0.8.0"
toml = "0.2"
diesel = { version = "0.11.0", features = ["postgres", "serde_json"] }
diesel_codegen = { version = "0.11.0", features = ["postgres"] }
r2d2-diesel = "0.11.0"
diesel_full_text_search = "0.11.0"

conduit = "0.8"
conduit-conditional-get = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: ./target/release/migrate && bin/start-nginx ./target/release/server
web: ./target/release/migrate && bin/diesel migration run && bin/start-nginx ./target/release/server
worker: ./target/release/update-downloads daemon 300
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ After cloning the repo, do the following:
2. Copy the `.env.sample` file to `.env`. Some settings will need to be
modified. These instructions are in the subsequent sections.

3. Install `diesel_cli` using `cargo install diesel_cli --no-default-features
--features postgres`.

### Running Tests

After following the above instructions:
Expand Down Expand Up @@ -158,7 +161,7 @@ After following the instructions described in "Working on the Backend":
5. Run the migrations:

```
./target/debug/migrate
diesel migration run
```

6. Start the backend server:
Expand Down
1 change: 1 addition & 0 deletions migrations/20140924113530_dumped_migration_1/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE users;
6 changes: 6 additions & 0 deletions migrations/20140924113530_dumped_migration_1/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR NOT NULL UNIQUE,
gh_access_token VARCHAR NOT NULL,
api_token VARCHAR NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140924114003_dumped_migration_2/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE packages;
5 changes: 5 additions & 0 deletions migrations/20140924114003_dumped_migration_2/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE packages (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL UNIQUE,
user_id INTEGER NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140924114059_dumped_migration_3/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE versions;
5 changes: 5 additions & 0 deletions migrations/20140924114059_dumped_migration_3/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE versions (
id SERIAL PRIMARY KEY,
package_id INTEGER NOT NULL,
num VARCHAR NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140924115329_dumped_migration_4/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions DROP CONSTRAINT unique_num;
1 change: 1 addition & 0 deletions migrations/20140924115329_dumped_migration_4/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions ADD CONSTRAINT unique_num UNIQUE (package_id, num);
1 change: 1 addition & 0 deletions migrations/20140924120803_dumped_migration_5/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE version_dependencies;
4 changes: 4 additions & 0 deletions migrations/20140924120803_dumped_migration_5/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE version_dependencies (
version_id INTEGER NOT NULL,
depends_on_id INTEGER NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140925132248_dumped_migration_6/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages DROP COLUMN updated_at;
1 change: 1 addition & 0 deletions migrations/20140925132248_dumped_migration_6/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT now();
1 change: 1 addition & 0 deletions migrations/20140925132249_dumped_migration_7/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages DROP COLUMN created_at;
1 change: 1 addition & 0 deletions migrations/20140925132249_dumped_migration_7/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages ADD COLUMN created_at TIMESTAMP NOT NULL DEFAULT now();
Empty file.
2 changes: 2 additions & 0 deletions migrations/20140925132250_dumped_migration_8/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UPDATE packages SET updated_at = now() WHERE updated_at IS NULL;
UPDATE packages SET created_at = now() WHERE created_at IS NULL;
1 change: 1 addition & 0 deletions migrations/20140925132251_dumped_migration_9/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions DROP COLUMN updated_at;
1 change: 1 addition & 0 deletions migrations/20140925132251_dumped_migration_9/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT now();
1 change: 1 addition & 0 deletions migrations/20140925132252_dumped_migration_10/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions DROP COLUMN created_at;
1 change: 1 addition & 0 deletions migrations/20140925132252_dumped_migration_10/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions ADD COLUMN created_at TIMESTAMP NOT NULL DEFAULT now();
Empty file.
2 changes: 2 additions & 0 deletions migrations/20140925132253_dumped_migration_11/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
UPDATE versions SET updated_at = now() WHERE updated_at IS NULL;
UPDATE versions SET created_at = now() WHERE created_at IS NULL;
Empty file.
4 changes: 4 additions & 0 deletions migrations/20140925132254_dumped_migration_12/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE versions ALTER COLUMN updated_at DROP DEFAULT;
ALTER TABLE versions ALTER COLUMN created_at DROP DEFAULT;
ALTER TABLE packages ALTER COLUMN updated_at DROP DEFAULT;
ALTER TABLE packages ALTER COLUMN created_at DROP DEFAULT;
1 change: 1 addition & 0 deletions migrations/20140925153704_dumped_migration_13/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE metadata;
3 changes: 3 additions & 0 deletions migrations/20140925153704_dumped_migration_13/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE metadata (
total_downloads BIGINT NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140925153705_dumped_migration_14/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DELETE FROM metadata;
1 change: 1 addition & 0 deletions migrations/20140925153705_dumped_migration_14/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO metadata (total_downloads) VALUES (0);
1 change: 1 addition & 0 deletions migrations/20140925161623_dumped_migration_15/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages DROP COLUMN downloads;
1 change: 1 addition & 0 deletions migrations/20140925161623_dumped_migration_15/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages ADD COLUMN downloads INTEGER NOT NULL DEFAULT 0;
1 change: 1 addition & 0 deletions migrations/20140925161624_dumped_migration_16/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions DROP COLUMN downloads;
1 change: 1 addition & 0 deletions migrations/20140925161624_dumped_migration_16/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions ADD COLUMN downloads INTEGER NOT NULL DEFAULT 0;
Empty file.
2 changes: 2 additions & 0 deletions migrations/20140925161625_dumped_migration_17/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE versions ALTER COLUMN downloads DROP DEFAULT;
ALTER TABLE packages ALTER COLUMN downloads DROP DEFAULT;
1 change: 1 addition & 0 deletions migrations/20140926130044_dumped_migration_18/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages DROP COLUMN max_version;
1 change: 1 addition & 0 deletions migrations/20140926130044_dumped_migration_18/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE packages ADD COLUMN max_version VARCHAR;
1 change: 1 addition & 0 deletions migrations/20140926130046_dumped_migration_19/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions ALTER COLUMN downloads DROP NOT NULL;
1 change: 1 addition & 0 deletions migrations/20140926130046_dumped_migration_19/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions ALTER COLUMN downloads SET NOT NULL;
2 changes: 2 additions & 0 deletions migrations/20140926174020_dumped_migration_20/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE crates RENAME TO packages;
ALTER TABLE versions RENAME COLUMN crate_id TO package_id;
2 changes: 2 additions & 0 deletions migrations/20140926174020_dumped_migration_20/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE packages RENAME TO crates;
ALTER TABLE versions RENAME COLUMN package_id TO crate_id;
1 change: 1 addition & 0 deletions migrations/20140929103749_dumped_migration_21/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_crate_updated_at;
1 change: 1 addition & 0 deletions migrations/20140929103749_dumped_migration_21/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_crate_updated_at ON crates (updated_at);
1 change: 1 addition & 0 deletions migrations/20140929103750_dumped_migration_22/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_crate_created_at;
1 change: 1 addition & 0 deletions migrations/20140929103750_dumped_migration_22/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_crate_created_at ON crates (created_at);
1 change: 1 addition & 0 deletions migrations/20140929103751_dumped_migration_23/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_crate_downloads;
1 change: 1 addition & 0 deletions migrations/20140929103751_dumped_migration_23/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_crate_downloads ON crates (downloads);
1 change: 1 addition & 0 deletions migrations/20140929103752_dumped_migration_24/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_version_crate_id;
1 change: 1 addition & 0 deletions migrations/20140929103752_dumped_migration_24/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_version_crate_id ON versions (crate_id);
1 change: 1 addition & 0 deletions migrations/20140929103753_dumped_migration_25/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_version_num;
1 change: 1 addition & 0 deletions migrations/20140929103753_dumped_migration_25/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_version_num ON versions (num);
1 change: 1 addition & 0 deletions migrations/20140929103754_dumped_migration_26/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_version_dependencies_version_id;
1 change: 1 addition & 0 deletions migrations/20140929103754_dumped_migration_26/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_version_dependencies_version_id ON version_dependencies (version_id);
1 change: 1 addition & 0 deletions migrations/20140929103755_dumped_migration_27/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_version_dependencies_depends_on_id;
1 change: 1 addition & 0 deletions migrations/20140929103755_dumped_migration_27/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_version_dependencies_depends_on_id ON version_dependencies (depends_on_id);
1 change: 1 addition & 0 deletions migrations/20140929103756_dumped_migration_28/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE crate_downloads;
6 changes: 6 additions & 0 deletions migrations/20140929103756_dumped_migration_28/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE crate_downloads (
id SERIAL PRIMARY KEY,
crate_id INTEGER NOT NULL,
downloads INTEGER NOT NULL,
date TIMESTAMP NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140929103757_dumped_migration_29/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_crate_downloads_crate_id;
1 change: 1 addition & 0 deletions migrations/20140929103757_dumped_migration_29/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_crate_downloads_crate_id ON crate_downloads (crate_id);
1 change: 1 addition & 0 deletions migrations/20140929103758_dumped_migration_30/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_crate_downloads_date;
1 change: 1 addition & 0 deletions migrations/20140929103758_dumped_migration_30/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_crate_downloads_date ON crate_downloads (date(date));
1 change: 1 addition & 0 deletions migrations/20140929103759_dumped_migration_31/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE version_downloads;
8 changes: 8 additions & 0 deletions migrations/20140929103759_dumped_migration_31/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE version_downloads (
id SERIAL PRIMARY KEY,
version_id INTEGER NOT NULL,
downloads INTEGER NOT NULL,
counted INTEGER NOT NULL,
date TIMESTAMP NOT NULL,
processed BOOLEAN NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140929103760_dumped_migration_32/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_version_downloads_version_id;
1 change: 1 addition & 0 deletions migrations/20140929103760_dumped_migration_32/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_version_downloads_version_id ON version_downloads (version_id);
1 change: 1 addition & 0 deletions migrations/20140929103761_dumped_migration_33/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_version_downloads_date;
1 change: 1 addition & 0 deletions migrations/20140929103761_dumped_migration_33/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_version_downloads_date ON version_downloads (date(date));
1 change: 1 addition & 0 deletions migrations/20140929103763_dumped_migration_34/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_version_downloads_processed;
2 changes: 2 additions & 0 deletions migrations/20140929103763_dumped_migration_34/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE INDEX index_version_downloads_processed ON version_downloads (processed)
WHERE processed = FALSE;
1 change: 1 addition & 0 deletions migrations/20140929185718_dumped_migration_35/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_crates_name_search;
1 change: 1 addition & 0 deletions migrations/20140929185718_dumped_migration_35/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_crates_name_search ON crates USING gin(to_tsvector('english', name));
3 changes: 3 additions & 0 deletions migrations/20140930082104_dumped_migration_36/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE version_dependencies (
version_id INTEGER
);
1 change: 1 addition & 0 deletions migrations/20140930082104_dumped_migration_36/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE version_dependencies;
1 change: 1 addition & 0 deletions migrations/20140930082105_dumped_migration_37/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE dependencies;
9 changes: 9 additions & 0 deletions migrations/20140930082105_dumped_migration_37/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE dependencies (
id SERIAL PRIMARY KEY,
version_id INTEGER NOT NULL,
crate_id INTEGER NOT NULL,
req VARCHAR NOT NULL,
optional BOOLEAN NOT NULL,
default_features BOOLEAN NOT NULL,
features VARCHAR NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20140930085441_dumped_migration_38/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions DROP COLUMN features;
1 change: 1 addition & 0 deletions migrations/20140930085441_dumped_migration_38/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE versions ADD COLUMN features VARCHAR;
1 change: 1 addition & 0 deletions migrations/20140930203145_dumped_migration_39/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_dependencies_version_id;
1 change: 1 addition & 0 deletions migrations/20140930203145_dumped_migration_39/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_dependencies_version_id ON dependencies (version_id);
1 change: 1 addition & 0 deletions migrations/20140930203146_dumped_migration_40/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_dependencies_crate_id;
1 change: 1 addition & 0 deletions migrations/20140930203146_dumped_migration_40/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_dependencies_crate_id ON dependencies (crate_id);
1 change: 1 addition & 0 deletions migrations/20141001190227_dumped_migration_41/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users DROP COLUMN gh_login;
1 change: 1 addition & 0 deletions migrations/20141001190227_dumped_migration_41/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users ADD COLUMN gh_login VARCHAR NOT NULL;
1 change: 1 addition & 0 deletions migrations/20141001190228_dumped_migration_42/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users DROP COLUMN name;
1 change: 1 addition & 0 deletions migrations/20141001190228_dumped_migration_42/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users ADD COLUMN name VARCHAR;
1 change: 1 addition & 0 deletions migrations/20141001190229_dumped_migration_43/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_users_gh_login;
1 change: 1 addition & 0 deletions migrations/20141001190229_dumped_migration_43/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_users_gh_login ON users (gh_login);
1 change: 1 addition & 0 deletions migrations/20141001190230_dumped_migration_44/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users ALTER COLUMN email SET NOT NULL;
1 change: 1 addition & 0 deletions migrations/20141001190230_dumped_migration_44/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users ALTER COLUMN email DROP NOT NULL;
1 change: 1 addition & 0 deletions migrations/20141001190231_dumped_migration_45/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users DROP COLUMN gh_avatar;
1 change: 1 addition & 0 deletions migrations/20141001190231_dumped_migration_45/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE users ADD COLUMN gh_avatar VARCHAR;
1 change: 1 addition & 0 deletions migrations/20141002195939_dumped_migration_46/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_crates_user_id;
1 change: 1 addition & 0 deletions migrations/20141002195939_dumped_migration_46/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_crates_user_id ON crates (user_id);
1 change: 1 addition & 0 deletions migrations/20141002195940_dumped_migration_47/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE follows;
4 changes: 4 additions & 0 deletions migrations/20141002195940_dumped_migration_47/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE follows (
user_id INTEGER NOT NULL,
crate_id INTEGER NOT NULL
);
1 change: 1 addition & 0 deletions migrations/20141002195941_dumped_migration_48/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX index_follows_user_id;
1 change: 1 addition & 0 deletions migrations/20141002195941_dumped_migration_48/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE INDEX index_follows_user_id ON follows (user_id);
1 change: 1 addition & 0 deletions migrations/20141002222426_dumped_migration_49/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE crate_downloads DROP CONSTRAINT fk_crate_downloads_crate_id;
2 changes: 2 additions & 0 deletions migrations/20141002222426_dumped_migration_49/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE crate_downloads ADD CONSTRAINT fk_crate_downloads_crate_id
FOREIGN KEY (crate_id) REFERENCES crates (id);
1 change: 1 addition & 0 deletions migrations/20141002222427_dumped_migration_50/down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE crates DROP CONSTRAINT fk_crates_user_id;
Loading