Sha256: a65cc87d1a318b4de295b7623a39fe6d13c0e93166a182ff6b3c599c8f2cb457

Contents?: true

Size: 1.39 KB

Versions: 16

Compression:

Stored size: 1.39 KB

Contents

\connect postgres

drop database if exists fox;
create database fox;

\connect fox

create unlogged table roles (
  id integer generated by default as identity primary key,
  name text not null,
  active boolean not null default true
);

create unlogged table pictures (
  id integer generated by default as identity primary key,
  title text not null,
  blob text not null
);

create unlogged table users (
  id integer generated by default as identity primary key,
  name text not null,
  age integer,
  role_id integer not null references roles(id),
  picture_id integer unique references pictures(id)
);

create unlogged table blogs (
  id integer generated by default as identity primary key,
  user_id integer not null references users(id),
  title text not null
);

create unlogged table posts (
  id integer generated by default as identity primary key,
  blog_id integer not null references blogs(id),
  head text not null,
  body text not null,
  created_at timestamp without time zone default (now() at time zone 'UTC')
);

create unlogged table comments (
  id integer generated by default as identity primary key,
  post_id integer not null references posts(id),
  author_id integer not null references users(id),
  head text not null,
  body text not null,
  created_at timestamp without time zone default (now() at time zone 'UTC')
);

alter table users add column last_post_id integer references posts(id);

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fixture_fox-0.2.12 examples/base.sql
fixture_fox-0.2.11 examples/base.sql
fixture_fox-0.2.10 examples/base.sql
fixture_fox-0.2.9 examples/base.sql
fixture_fox-0.2.8 examples/base.sql
fixture_fox-0.2.7 examples/base.sql
fixture_fox-0.2.6 examples/base.sql
fixture_fox-0.2.5 examples/base.sql
fixture_fox-0.2.4 examples/base.sql
fixture_fox-0.2.3 examples/base.sql
fixture_fox-0.2.2 examples/base.sql
fixture_fox-0.2.1 examples/base.sql
fixture_fox-0.2.0 examples/base.sql
fixture_fox-0.1.3 examples/base.sql
fixture_fox-0.1.2 examples/base.sql
fixture_fox-0.1.1 examples/base.sql