Sha256: 5f5acb4f7edffbc59d7f2411c866fc822629fc8565a44cf702c6994bf2dd8dea

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

= pg_audit_log

* http://github.com/casecommons/pg_audit_log/

== DESCRIPTION

PostgreSQL only database-level audit logging of all databases changes using a completely transparent stored procedure and triggers.
Comes with specs for your project and a rake task to generate the reverse SQL to undo changes logged}

All SQL INSERTs, UPDATEs, and DELETEs will be captured. Record columns that do not change do not generate an audit log entry.

Compatible with Rails 3.0.x and 3.1.x

== INSTALL

=== Enable plpgsql langauges in your postgresql instance

  As a superuser in postgres make sure your database has plpgsql enabled:

  CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;

=== Rails 3

  $ rails generate pg_audit_log:install

=== Installing the PostgreSQL function and triggers for your project

  $ rake pg_audit_log:install

== Using on your project

The PgAuditLog::Entry ActiveRecord model represents a single entry in the audit log table. Each entry represents a single change to a single field of a record in a table. So if you change 3 columns of a record, that will generate 3 corresponding PgAuditLog::Entry records.

=== Migrations

TODO

=== schema.rb and development_structure.sql

Since schema.rb cannot represent TRIGGERs or FUNCTIONs you will need to set your environment to generate SQL instead of ruby for your database schema and structure. In your application environment put the following:

  config.active_record.schema_format = :sql

And you can generate this sql using:

  $ rake db:structure:dump

=== Uninstalling

  $ rake pg_audit_log:uninstall

== REQUIREMENTS

* ActiveRecord

== LICENSE

MIT

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pg_audit_log-0.4.0 README.rdoc