Skip to content

Instantly share code, notes, and snippets.

View hackvan's full-sized avatar
🇨🇴

Diego Camacho hackvan

🇨🇴
View GitHub Profile
defmodule Super.RepoTest do
use Super.DataCase, async: true
require Logger
@skipped_schemas [UserService.User]
defp tenant_schemas do
{:ok, mods} = :application.get_key(:super, :modules)
Enum.map(mods, fn mod ->
# Clean the database
DROP TABLE IF EXISTS _orders CASCADE;
DROP TABLE IF EXISTS _users CASCADE;
DROP TABLE IF EXISTS orders CASCADE;
DROP TABLE IF EXISTS users CASCADE;
# Build the database (for hard deletion)
CREATE TABLE users (
id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name text NOT NULL
@hackvan
hackvan / postgres-cheatsheet.md
Last active July 6, 2017 23:39 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

To have launchd start postgresql now and restart at login:

brew services start postgresql

Or, if you don't want/need a background service you can just run:

pg_ctl -D /usr/local/var/postgres start
@hackvan
hackvan / zsh.md
Last active September 15, 2016 02:37 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu